Skip to content

Commit 0ec2b45

Browse files
authored
Update design-underground-system.py
1 parent f903683 commit 0ec2b45

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Python/design-underground-system.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Time: O(n)
1+
# Time: ctor: O(1)
2+
# checkin: O(1)
3+
# checkout: O(1)
4+
# getaverage: O(1)
25
# Space: O(n)
36

47
import collections
@@ -37,5 +40,5 @@ def getAverageTime(self, startStation, endStation):
3740
:type endStation: str
3841
:rtype: float
3942
"""
40-
numer, denom = self.__statistics[startStation, endStation]
41-
return float(numer) / denom
43+
total_time, cnt = self.__statistics[startStation, endStation]
44+
return float(total_time) / cnt

0 commit comments

Comments
 (0)