Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 프로그래머스
- intarray
- heap
- dynamic programming
- Queue
- Developer
- 코틀린
- Main
- 2D Array
- Util
- PriorityQueue
- Kotlin
- programmers
- dp
- hackerrank
- booleanarray
- solution
- indices
- GREEDY
- 알고리즘
- sortedBy
- 동적계획법
- report
- Poll
- Recursion
- 2020
- foreach
- lastIndex
- contentToString
- Java
Archives
- Today
- Total
목록sortDescending (1)
Code in
프로그래머스 정렬 부분 H-Index 문제이다. IntelliJ에서의 풀이이다. var citations: IntArray = intArrayOf(3, 0, 6, 1, 5) fun solution(citations: IntArray): Int { var answer = 0 val n = citations.size // 발표한 논문 n // val은 value, var은 variable이다. // val은 값 할당 후, 값을 변경할 수 없다. var는 변경 가능하다. citations.sortDescending() // 6, 5, 3, 1, 0 // 인용된 횟수 큰 순서=내림차 순 for(i in 0 until n) // i는 0 1 2 3 4 Index가 인용된 편 수 h 이다. if (citations..
알고리즘 스터디_문제풀이
2020. 8. 10. 21:57