01 · Question
Given an integer array nums and an integer k, return the kth largest element in the array.
Assume 1 <= k <= len(nums); duplicate values occupy separate ranks.
02 · Analysis
Keep a min-heap of at most k values. After inserting a value, discard the smallest if necessary; the heap retains the largest k values of the processed prefix. Its root is the kth largest, counting duplicate occurrences separately. Require 1 <= k <= len(nums). Time O(n log(k+1)), auxiliary space O(k).