Files
developer-roadmap/roadmaps/leetcode/content/kth-largest-element-in-an-array@tMvbBpZDawi2RjSFgOaWc.md
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

744 B

Kth Largest Element in an Array

Given an unsorted array and an integer k, return the kth largest element. You can use a min-heap of size k: iterate through the array, push each element, and pop when the heap exceeds k. The top of the heap is then the kth largest. This problem teaches the core heap pattern: maintain a fixed-size heap to track top-k elements without sorting the entire array.

Visit the following resources to learn more: