Simple&Natural
Codility lesson3 - FrogJmp 본문
728x90
fun solution(X: Int, Y: Int, D: Int): Int {
if (X==Y) return 0
return if ((Y-X)%D==0) (Y-X)/D else ((Y-X)/D)+1
}
728x90
'코딩테스트 풀이 > Codility' 카테고리의 다른 글
Codility lesson3 - TapeEquilibrium (0) | 2022.04.28 |
---|---|
Codility lesson3 - PermMissingElem (0) | 2022.04.27 |
Codility lesson2 - odd (0) | 2022.04.20 |
Codility lesson2 - cyclic rotation (0) | 2022.04.18 |
Codilidy lesson1 - binary gap (0) | 2022.04.17 |