Your question is K-th Largest Element Efficiently. 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.
CrowdStrike Falcon may need to identify a score threshold among a large, unsorted set of detections. Given an unsorted integer array nums and an integer k, return the K-th largest value in the array.
You should design an efficient solution that avoids fully sorting the array. Duplicate values count as separate elements, so the largest value is the 1st largest, and the smallest value is the nums.length-th largest.
Implement find_kth_largest(nums, k).
nums, a list of integers, and k, an integer.nums.nums during execution.def find_kth_largest(nums, k):