Skip to content

Commit 8f5a264

Browse files
authored
Update stock-price-fluctuation.py
1 parent 6c041a4 commit 8f5a264

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/stock-price-fluctuation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ def maximum(self):
3838
"""
3939
:rtype: int
4040
"""
41-
return self.__sl_by_price[-1]
41+
return next(reversed(self.__sl_by_price))
4242

4343
def minimum(self):
4444
"""
4545
:rtype: int
4646
"""
47-
return self.__sl_by_price[0]
47+
return next(iter(self.__sl_by_price))
4848

4949

5050
# Time: ctor: O(1)

0 commit comments

Comments
 (0)