We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dccc50a commit 3530508Copy full SHA for 3530508
4-non-linear-data-structures/ch15/55-1.py
@@ -8,7 +8,7 @@ def findKthLargest(self, nums: List[int], k: int) -> int:
8
for n in nums:
9
heapq.heappush(heap, -n)
10
11
- for _ in range(k):
+ for _ in range(1, k):
12
heapq.heappop(heap)
13
14
return -heapq.heappop(heap)
0 commit comments