This question evaluates a candidate's understanding of selection algorithms and array manipulation, focusing on order statistics and correct handling of duplicates in an unsorted integer array.

Given an integer array nums and an integer k, return the k-th largest element in the array.
Notes:
k-1
if the array were sorted in
descending
order.
[5,5,4]
,
k=2
→ answer
5
).
nums
: array of integers
k
: integer where
1 <= k <= len(nums)
1 <= n <= 2 * 10^5
-10^9 <= nums[i] <= 10^9
nums = [3,2,1,5,6,4], k = 2
→ answer
5