My approach:

- Sort vector in ascending order - O(n log n)
- Iterate backwards - O(n)
- Increment h-index while citations are greater than h-index and iterator >= 0

3ms runtime and O(N log N) time complexity.

```
class Solution {
public:
int hIndex(vector<int>& citations) {
if(citations.empty()) return 0;
sort(citations.begin(), citations.end());
int h = 0;
for (vector<int>::size_type i = citations.size()-1; i >= 0 && citations[i] > h; i--) h++;
return h;
}
};
```