728x90
1 2 3 4 | public int solution(int X, int Y, int D) { // write your code in Java SE 8 return (Y-X)%D==0? (Y-X)/D : (Y-X)/D+1; } | cs |
'알고리즘 풀이 > Codility' 카테고리의 다른 글
codility - Time Complexity (TapeEquilibrium) (0) | 2019.12.10 |
---|---|
codility - Time Complexity (PermMissingElem) (0) | 2019.12.10 |
codility - Arrays (CyclicRotation) (0) | 2019.12.09 |
codility - Arrays (OddOccurrencesInArray) (0) | 2019.12.09 |
codility - Iterations (BinaryGap) (0) | 2019.12.09 |