Skip to content

Commit 6c041a4

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/stock-price-fluctuation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def full_delete(heap, sign): # Time: O(n), Space: O(n)
7979
self.__lookup[timestamp] = price
8080
heapq.heappush(self.__min_heap, (price, timestamp))
8181
heapq.heappush(self.__max_heap, (-price, timestamp))
82-
if len(self.__min_heap) > 2*len(self.__lookup): # avoid too much expired data
82+
if len(self.__min_heap) > 2*len(self.__lookup): # avoid too much expired or duplicated data
8383
full_delete(self.__min_heap, 1)
8484
full_delete(self.__max_heap, -1)
8585

0 commit comments

Comments
 (0)