Kotlin/코딩테스트
[프로그래머스] 연속된 수의 합 - kotlin
깨노비
2023. 3. 11. 22:47
728x90
반응형
class Solution {
fun solution(num: Int, total: Int): IntArray {
return (total / num - (num - 1) / 2).let {
from -> IntArray(num) { idx -> idx + from }
}
}
}
728x90
반응형