...

/

Solution: Kth Largest Element in an Array

Solution: Kth Largest Element in an Array

Let's solve the Kth Largest Element in an Array problem using the Top K Elements pattern.

Statement

Find the kthk^{th} largest element in an unsorted array.

Note: We need to find the kthk^{th} largest element in the sorted order, not the kthk^{th} distinct element.

Constraints:

  • 11 \leq k \leq nums.length 1 ...