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 5168b04 commit 1269ea6Copy full SHA for 1269ea6
jump-game/HC-kang.ts
@@ -9,7 +9,7 @@ function canJump(nums: number[]): boolean {
9
for (let i = 0; i < nums.length; i++) {
10
if (i > max) return false;
11
max = Math.max(max, i + nums[i]);
12
- if (max >= nums.length) return true;
+ if (max >= nums.length - 1) return true;
13
}
14
15
return false;
0 commit comments