Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d19b107

Browse files
Merge pull request onlybooks#35 from Wdean45/patch-1
Update 55-1.py
2 parents dccc50a + 3530508 commit d19b107

File tree

1 file changed

+1
-1
lines changed
  • 4-non-linear-data-structures/ch15

1 file changed

+1
-1
lines changed

‎4-non-linear-data-structures/ch15/55-1.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def findKthLargest(self, nums: List[int], k: int) -> int:
88
for n in nums:
99
heapq.heappush(heap, -n)
1010

11-
for _ in range(k):
11+
for _ in range(1, k):
1212
heapq.heappop(heap)
1313

1414
return -heapq.heappop(heap)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /