Leetcode 2113 Solution
This article provides solution to leetcode question 2113 (find-the-kth-largest-integer-in-the-array)
Access this page by simply typing in "lcs 2113" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/find-the-kth-largest-integer-in-the-array
Solution
class Solution:
def kthLargestNumber(self, nums: List[str], k: int) -> str:
q = []
for num in nums:
heapq.heappush(q, (len(num), num))
if len(q) > k:
heapq.heappop(q)
return heapq.heappop(q)[1]