Skip to content

Commit 1df2358

Browse files
authored
Update path-with-minimum-effort.py
1 parent 03481e2 commit 1df2358

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/path-with-minimum-effort.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def minimumEffortPath(self, heights):
1414
directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
1515
dst = (len(heights)-1, len(heights[0])-1)
1616
dist = [[float("inf")]*len(heights[0]) for _ in xrange(len(heights))]
17+
dist[0][0] = 0;
1718
min_heap = [(0, 0, 0)]
1819
lookup = [[False]*len(heights[0]) for _ in xrange(len(heights))]
1920
while min_heap:

0 commit comments

Comments
 (0)