1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// you can also use imports, for example:
// import java.util.*;
// you can write to stdout for debugging purposes, e.g.
// System.out.println("this is a debug message");
class Solution {
public int solution(int X, int Y, int D) {
// write your code in Java SE 8
if ((Y-X)%D == 0) return ((Y-X)/D);
else return ((Y-X)/D) + 1;
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
'Codility > JAVA' 카테고리의 다른 글
TapeEquilibrium (0) | 2020.02.15 |
---|---|
OddOccurencesInArray (0) | 2020.02.15 |
Cyclic Rotation (0) | 2020.02.15 |
Binary Gap (0) | 2020.02.15 |