Skip to content

Commit e011ca7

Browse files
author
applewjg
committed
udpate
Change-Id: If89cd6a1f6d0600a99d1f66285988e938994e530
1 parent 61ad1e0 commit e011ca7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

JumpGameII.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public int jump(int[] A) {
2222
if (i > last) {
2323
res++;
2424
last = cur;
25+
if (cur >= n - 1) return res;
2526
}
2627
cur = Math.max(cur, i + A[i]);
2728
}

0 commit comments

Comments
 (0)