Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 66cf6cc

Browse files
Update and rename k_element_stream.py to kth_largest_stream.py
1 parent f75b102 commit 66cf6cc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

heaps/k_element_stream.py renamed to heaps/kth_largest_stream.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ def __init__(self, k, nums):
1414
while len(self.heap) > k:
1515
heapq.heappop(self.heap)
1616

17-
1817
def add(self, val: int) -> int:
1918

2019
heapq.heappush(self.heap, val)
2120
if len(self.heap) > self.k:
2221
heapq.heappop(self.heap)
2322

2423
return self.heap[0]
25-
26-
27-
24+

0 commit comments

Comments
 (0)