Skip to content

Commit 3530508

Browse files
authored
Update 55-1.py
기존 K+1번째 값이 아닌 K번째 값이 추출되도록 변경하였습니다.
1 parent dccc50a commit 3530508

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)