Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def findKthLargest(self, nums: List[int], k: int) -> int:
- heapq.heapify(nums)
- while len(nums) > k:
- heapq.heappop(nums)
- return nums[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement