Skip to content

Commit d185487

Browse files
authored
Update furthest-building-you-can-reach.py
1 parent d6a346d commit d185487

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/furthest-building-you-can-reach.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def furthestBuilding(self, heights, bricks, ladders):
1717
diff = heights[i+1]-heights[i]
1818
if diff > 0:
1919
heapq.heappush(min_heap, diff)
20-
if len(min_heap) <= ladders: # ladders are reserved for top diffs
20+
if len(min_heap) <= ladders: # ladders are reserved for largest diffs
2121
continue
2222
bricks -= heapq.heappop(min_heap) # use bricks if ladders are not enough
2323
if bricks < 0: # not enough bricks

0 commit comments

Comments
 (0)