Glance needs to identify a score threshold for ranking content in a feed. Given an unsorted array of integers nums and an integer k, return the k-th largest element in nums.
The largest element is the 1st largest, and duplicate values count as separate elements. You may modify the input array during processing.
nums, a non-empty list of integers, and k, a 1-indexed integer.nums.O(n) time and O(1) auxiliary space by using an in-place selection algorithm.def kth_largest(nums, k):