0215 Kth Largest Element in an Array
Warning
This post is more than a year old. Information may be outdated.
Solved at: 220830
Question
Given an integer array nums and an integer k, return the kth largest element in the array.
Note that it is the kth largest element in the sorted order, not the kth distinct element.
You must solve it in O(n) time complexity.
Solution
- Use QuickSelect