The difference with the quicksort is just that we can ignoe a part after partition and we can stop if the partion privot is the result;So it is just a little different with quicksort

```
class Solution {
public:
int aim;
int findKthLargest(vector<int>& nums, int k) {
aim=k-1;
return find(0,nums.size()-1,nums);
}
int find(int m,int l,vector<int>& nums){
if(m>=l) return nums[m];
int p=m;
for(int i=m+1;i<=l;i++){
if(nums[i]>=nums[m]) swap(nums[++p],nums[i]);
}
swap(nums[p],nums[m]);
if(p-m==aim) return nums[p];
else{
if(p-m<aim){
aim-=p-m+1;
return find( p+1,l,nums);
}
else return find(m,p-1,nums);
}
}
};
```