Skip to content

Commit 3b42e9f

Browse files
committed
[TimeComplexity] Codility-FrogJmp
1 parent 4a099ff commit 3b42e9f

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Diff for: โ€ŽREADME.md

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
| 03 | โญ๏ธ | [Baekjoon-2143 ๋‘ ๋ฐฐ์—ด์˜ ํ•ฉ](./src/TimeComplexity/P2143) | Lower Bound & Upper Bound |
6767
| 04 | | [Baekjoon-2748 ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜ 2](./src/TimeComplexity/P2748) | DP |
6868
| 05 | | [Baekjoon-1806 ๋ถ€๋ถ„ํ•ฉ](./src/TimeComplexity/P1806) | 2-pointer |
69+
| 06 | | [Codility-Lesson3 FrogJmp](./src/TimeComplexity/FrogJmp) | |
6970

7071
## Data Structure
7172

Diff for: โ€Žsrc/TimeComplexity/FrogJmp/Main.java

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package TimeComplexity.FrogJmp;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
Solution sol = new Solution();
6+
System.out.println(sol.solution(10, 10, 30));
7+
System.out.println(sol.solution(10, 85, 30));
8+
}
9+
}
10+
11+
class Solution {
12+
public int solution(int X, int Y, int D) {
13+
Y -= X;
14+
return (int) Math.ceil((double) Y / (double) D);
15+
}
16+
}

Diff for: โ€Žsrc/TimeComplexity/FrogJmp/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## [Codility - Lesson 3 Time Complexity] FrogJmp
2+
3+
> Detected time complexity : **O(1)**
4+
5+
![image](https://user-images.githubusercontent.com/22045163/101915925-9c532900-3c09-11eb-9997-0cde24f0c5a4.png)

0 commit comments

Comments
ย (0)