题目有问题
The definition of the index is that a scholar with an index of h has published h papers each of which has been cited in other papers at least h times.
class Solution {
public:
int hIndex(vector<int>& citations) {
sort(citations.rbegin(),citations.rend());
for(int i=0;iif(citations[i]<=i) return i;
return citations.size();
}
};