sort()排的是从小到大的升序
class Solution {
public:
int hIndex(vector<int>& citations) {
sort(citations.begin(), citations.end());
int h = 0, i = citations.size() - 1;
while(i >= 0 && citations[i] > h){
h++;
i--;
}
return h;
}
};