https://1chanhue1.tistory.com/60
오늘의 알고리즘 코드카타 문제
[프로그래머스 kotlin] 롤케이크 자르기
시간 초과 발생 코드 fun solution(topping: IntArray): Int { var count=0 for(i in topping.indices){ val set1 = mutableSetOf() val set2 = mutableSetOf() for(j in 0.. i){ set1.add(topping[j]) } for(k in i+1 until topping.size){ set2.add(topping[k]) }
1chanhue1.tistory.com
'내일배움캠프 > TIL' 카테고리의 다른 글
[TIL] 07.08 (0) | 2024.07.08 |
---|---|
[TIL] 07.03 (0) | 2024.07.03 |
[TIL] 06.27 (0) | 2024.06.27 |
[TIL] 06.26 (0) | 2024.06.26 |
[TIL] 06.21 (0) | 2024.06.21 |