Problem
A researcher's papers have citation counts citations, sorted in ascending order. Their h-index is the largest h such that at least h papers have at least `h` citations each. Return it, in logarithmic time.
Example 1
- Input
- citations = [0, 1, 3, 5, 6]
- Output
- 3
- Why
- three papers have at least 3 citations
Example 2
- Input
- citations = [1, 2, 100]
- Output
- 2
Example 3
- Input
- citations = [0]
- Output
- 0
Constraints
1 <= citations.length <= 10^50 <= citations[i] <= 1000citations is sorted in ascending order.