Skip to content

Commit fdff6de

Browse files
author
Ihssaneabousshal
committed
Runtime: 2 ms (Top 43.75%) | Memory: 41.9 MB (Top 57.50%)
1 parent 11773e3 commit fdff6de

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/algorithms/M/Moving Stones Until Consecutive/Moving Stones Until Consecutive.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 2 ms (Top 43.75%) | Memory: 41.9 MB (Top 57.50%)
12
class Solution {
23
public int[] numMovesStones(int a, int b, int c) {
34
int[] arr ={a,b,c};
@@ -19,13 +20,13 @@ public int findMaximum(int[] arr){
1920
count++;
2021
}
2122
return count + findMaximum(arr);
22-
23+
2324
}
24-
25+
2526
public int findMinimum(int max,int[] arr){
2627
Arrays.sort(arr);
2728
if(max == 0) return 0;
28-
else if(Math.abs(arr[0]-arr[1]) >2 && Math.abs(arr[1]-arr[2]) >2 ) return 2;
29+
else if(Math.abs(arr[0]-arr[1]) >2 && Math.abs(arr[1]-arr[2]) >2 ) return 2;
2930
else return 1;
3031
}
31-
}
32+
}

0 commit comments

Comments
 (0)