File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
src/TimeComplexity/FrogJmp Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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 )
You canโt perform that action at this time.
0 commit comments