Skip to content

Commit 7e5205d

Browse files
authored
Update minimum-jumps-to-reach-home.py
1 parent e0c6195 commit 7e5205d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/minimum-jumps-to-reach-home.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def minimumJumps(self, forbidden, a, b, x):
1111
:rtype: int
1212
"""
1313
max_f = max(forbidden)
14-
max_val = x+b if a >= b else max(x, max_f)+a+(b+a) # a may be a non-periodic area, b is a periodic area which requires extra a => (b+a)
14+
max_val = x+b if a >= b else max(x, max_f)+a+(b+a) # a may be a non-periodic area, (a+b) is a periodic area which is divided by gcd(a, b) and all points are reachable
1515
lookup = set()
1616
for pos in forbidden:
1717
lookup.add((pos, True))

0 commit comments

Comments
 (0)