mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 12:16:14 -04:00
Update and rename k_element_stream.py to kth_largest_stream.py
This commit is contained in:
parent
f75b102b78
commit
66cf6cc427
@ -14,7 +14,6 @@ class KthLargest:
|
||||
while len(self.heap) > k:
|
||||
heapq.heappop(self.heap)
|
||||
|
||||
|
||||
def add(self, val: int) -> int:
|
||||
|
||||
heapq.heappush(self.heap, val)
|
||||
@ -22,6 +21,4 @@ class KthLargest:
|
||||
heapq.heappop(self.heap)
|
||||
|
||||
return self.heap[0]
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user