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 d277c68 commit 24f627dCopy full SHA for 24f627d
jump-game/yhkee0404.dart
@@ -0,0 +1,11 @@
1
+class Solution {
2
+ bool canJump(List<int> nums) {
3
+ for (int i = 0, j = 0; j < nums.length - 1; i++) {
4
+ if (j < i) {
5
+ return false;
6
+ }
7
+ j = max(i + nums[i], j);
8
9
+ return true;
10
11
+}
0 commit comments