266. The H Index
A researcher's h-index is the largest h such that they have at least h
papers with at least h citations each.
Given the citation counts of n papers, print the h-index.
3 0 6 1 5 -> 3
Sorted descending that is 6 5 3 1 0. The first three papers have 6, 5 and 3
citations, all at least 3, so an h of 3 holds. A fourth would need four papers
with at least 4 citations each, and the fourth has only 1.
Sort descending and walk. At position i counting from 1, an h of i is
achievable exactly when the citation count there is at least i. The last
position where that holds is the answer.
Constraints - `1 ≤ n ≤ 200000` - `0 ≤ citations ≤ 1000000000`
Input
The first line contains an integer n.
The second line contains n citation counts.
Output
Print one integer, the h-index.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.