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 6104a75 commit 82cef7cCopy full SHA for 82cef7c
jump-game/moonjonghoo.js
@@ -0,0 +1,10 @@
1
+var canJump = function (nums) {
2
+ let maxReach = 0;
3
+
4
+ for (let i = 0; i < nums.length; i++) {
5
+ if (i > maxReach) return false;
6
+ maxReach = Math.max(maxReach, i + nums[i]);
7
+ }
8
9
+ return true;
10
+};
0 commit comments