Your question is Kth Largest Element. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Find the Kth Largest Element in an Array (LeetCode 215).
Asked in the Virtual Onsite stage. Candidate provided an O(n log k) heap solution and the interviewer moved on.
Write a function that returns the kth largest element in an integer array, where k is 1-based and duplicates count as separate values.
def findKthLargest(nums, k):
nums: list of integersk: integernums.def findKthLargest(nums, k):