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 ca162fd commit 435e438Copy full SHA for 435e438
jump-game/samthekorean.py
@@ -0,0 +1,10 @@
1
+# TC : O(n)
2
+# SC : O(1)
3
+class Solution:
4
+ def canJump(self, nums):
5
+ reachable = 0
6
+ for i in range(len(nums)):
7
+ if i > reachable:
8
+ return False
9
+ reachable = max(reachable, i + nums[i])
10
+ return True
0 commit comments