← 返回 meta 的题目列表Find the Kth Largest Element in an Array
类型:online_judge
Given an unsorted integer array, find the k-th largest element in it. Note that it is the k-th largest element in the sorted order, not the k-th distinct element.
Example 1:
Input: [3,2,1,5,6,4] and k=2
Output: 5
Constraints:
1 <= k <= array's length.
The data are unique.
Example
Input
[3,2,1,5,6,4] 2