Kth Largest Element in an Array — Interactive Visualizer

Keep a min-heap of size k while scanning nums; the root ends up as the kth largest.