본문 바로가기

Code in

검색하기
Code in
프로필사진 heyhmin

  • 분류 전체보기 (37)
    • 알고리즘 스터디_개념정리 (9)
    • 알고리즘 스터디_문제풀이 (22)
    • IT - TMI (4)
    • 프로젝트_AI랑 (2)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
  • Poll
  • lastIndex
  • Developer
  • 동적계획법
  • booleanarray
  • heap
  • sortedBy
  • 2020
  • GREEDY
  • 알고리즘
  • programmers
  • solution
  • indices
  • foreach
  • 코틀린
  • intarray
  • Kotlin
  • dynamic programming
  • Recursion
  • contentToString
  • report
  • Util
  • PriorityQueue
  • hackerrank
  • 프로그래머스
  • 2D Array
  • Main
  • Java
  • Queue
  • dp
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록lastIndex (1)

Code in

프로그래머스 탐욕법(Greedy) 조이스틱 with Kotlin

프로그래머스 탐욕법 부분 조이스틱 문제입니다. IntelliJ에서의 풀이입니다. import kotlin.math.abs val name: String = "BBAABB" // 'A': 65 ~ 'Z': 90 // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 12 11 10 9 8 7 6 5 4 3 2 1 fun solution(name: String): Int { var answer = 0 // 알파벳을 바꿀 때 최적화, 이동할 때 최적화 2개로 나누겠습니다. // 알파벳 변경 시의 최적화 var current: Int name.forEach { current = it.toInt() answe..

알고리즘 스터디_문제풀이 2020. 8. 17. 22:22
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바