Your question is Find Most K 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.
Dell PowerStore can produce large arrays of numeric telemetry values. Given an unsorted array, return the kth largest element, counting duplicate values as separate elements.
Design an algorithm that avoids sorting the entire array when k is relatively small.
Implement find_kth_largest(nums, k):
nums: a non-empty list of integers.k: an integer from 1 through len(nums).k when nums is ordered from largest to smallest.You may modify nums unless your chosen approach does not require it. Do not return the index or the distinct kth largest value.
def find_kth_largest(nums, k):