Skip to content

Commit 52641b2

Browse files
committed
Runtime: 70 ms (Top 44.94%) | Memory: 14.9 MB (Top 51.98%)
1 parent 2ebf0e3 commit 52641b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/J/Jump Game V/Jump Game V.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 70 ms (Top 44.94%) | Memory: 14.9 MB (Top 51.98%)
12
class Solution {
23
vector<int> dp;
34
int countJumps(vector<int>& arr, int i, int d){
@@ -16,7 +17,7 @@ class Solution {
1617
k = 1;
1718
while(k <= d && i - k >= 0){
1819
if(arr[i] > arr[i - k]){
19-
jumps = max(countJumps(arr, i-k, d)+1, jumps);
20+
jumps = max(countJumps(arr, i-k, d)+1, jumps);
2021
k++;
2122
}
2223
else{
@@ -35,4 +36,4 @@ class Solution {
3536
}
3637
return maxJumps + 1;
3738
}
38-
};
39+
};

0 commit comments

Comments
 (0)