Skip to content

Commit 75d3f7b

Browse files
committed
Runtime: 231 ms (Top 72.60%) | Memory: 19.2 MB (Top 61.18%)
1 parent c7083a6 commit 75d3f7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/F/Frog Jump/Frog Jump.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Runtime: 231 ms (Top 72.60%) | Memory: 19.2 MB (Top 61.18%)
12
class Solution:
23
def possible(self, i, n, stones, pos, allowedJumps):
34
if i == n - 1:
@@ -12,11 +13,11 @@ def possible(self, i, n, stones, pos, allowedJumps):
1213
return True
1314
self.cache[key] = False
1415
return False
15-
16+
1617
def canCross(self, stones: List[int]) -> bool:
1718
n = len(stones)
1819
pos = {}
1920
for i, stone in enumerate(stones):
2021
pos[stone] = i
2122
self.cache = {}
22-
return self.possible(0, n, stones, pos, [1])
23+
return self.possible(0, n, stones, pos, [1])

0 commit comments

Comments
 (0)