这道题 用快排速度不如用堆 简单易用
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
priority_queue<int, vector<int>, greater<int>> q;
for(auto num : nums){
q.push(num);
while(q.size() > k) q.pop();
}
return q.top();
}
};