Design a class to find the kth largest element in a stream. The class should support: KthLargest(k, nums) and add(val) which returns the kth largest element after adding val.
Maintain a min-heap of size k. The kth largest is always at the top of the heap.
- Initialize min-heap with up to k elements from nums.
- On add(val): offer val to heap; if size > k, poll the minimum.
- Return heap.peek() (the kth largest).
- Time Complexity: add: O(log k)
- Space Complexity: O(k)