Skip to content

Commit 3e0f07e

Browse files
55. Jump Game (java)
1 parent b26e95e commit 3e0f07e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

solution/0055.Jump Game/Solution.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
public boolean canJump(int[] nums) {
3+
int count=0;
4+
for(int i=nums.length-2;i>=0;i--) {
5+
if (nums[i] > count) count = 0;
6+
else count++;
7+
}
8+
return count==0;
9+
}
10+
}

0 commit comments

Comments
 (0)