Skip to content

Commit 0f696da

Browse files
authored
Update minimum-cost-to-make-at-least-one-valid-path-in-a-grid.py
1 parent 989e917 commit 0f696da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/minimum-cost-to-make-at-least-one-valid-path-in-a-grid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def minCost(self, grid):
4848
"""
4949
directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]
5050
R, C = len(grid), len(grid[0])
51-
t = (R-1, C-1)
52-
dq = collections.deque([((0, 0), 0)])
53-
lookup = {(0, 0): 0}
51+
b, t = (0, 0), (R-1, C-1)
52+
dq = collections.deque([(b, 0)])
53+
lookup = {b: 0}
5454
while dq:
5555
b, d = dq.popleft()
5656
if b == t:

0 commit comments

Comments
 (0)