We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 939af48 commit b20cff5Copy full SHA for b20cff5
rust/55-Jump-Game.rs
@@ -0,0 +1,11 @@
1
+pub fn can_jump(nums: Vec<i32>) -> bool {
2
+ let mut goal = nums.len() - 1;
3
+
4
+ for i in (0..goal).rev() {
5
+ if i + nums[i] as usize >= goal {
6
+ goal = i;
7
+ }
8
9
10
+ goal == 0
11
+}
0 commit comments