// Kth Largest Element in an Array — MEDIUM
// Category: heap
Given an integer array `nums` and an integer `k`, return the `k`th largest element in the array.
Note: it is the `k`th largest element in sorted order, not the `k`th distinct element.
Hint: Use a min-heap of size `k`. For each element, push it onto the heap. If the heap size exceeds `k`, pop the minimum. The heap's minimum is the kth largest.
Example: nums = [3, 2, 1, 5, 6, 4], k = 2
Output: 5