Skip to content

Commit 7001df8

Browse files
authored
Merge pull request #558 from UWDavidWu/main
Update 853-Car-Fleet.py
2 parents 22b7b9d + e30bafe commit 7001df8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

853-Car-Fleet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def carFleet(self, target: int, position: List[int], speed: List[int]) -> int:
33
pair = [[p, s] for p, s in zip(position, speed)]
44

55
stack = []
6-
for p, s in sorted(pair)[::-1]: # Reverse Sorted Order
6+
for p, s in sorted(pair, reverse=True):
77
stack.append((target - p) / s)
88
if len(stack) >= 2 and stack[-1] <= stack[-2]:
99
stack.pop()

0 commit comments

Comments
 (0)