A First Republic risk-monitoring workflow receives an unsorted array of integer scores. Return the kth largest score, counting duplicate values as separate positions.
Use a data structure that avoids sorting the entire array when k is relatively small.
Implement kth_largest(nums, k).
nums, a non-empty array of integers, and k, a positive integer.k - 1 after sorting nums in descending order.k elements.def kth_largest(nums, k):