diff --git a/4-non-linear-data-structures/ch15/55-1.py b/4-non-linear-data-structures/ch15/55-1.py index 368262d..aa76708 100644 --- a/4-non-linear-data-structures/ch15/55-1.py +++ b/4-non-linear-data-structures/ch15/55-1.py @@ -8,7 +8,7 @@ def findKthLargest(self, nums: List[int], k: int) -> int: for n in nums: heapq.heappush(heap, -n) - for _ in range(k): + for _ in range(1, k): heapq.heappop(heap) return -heapq.heappop(heap)