H-Index II
Medium · Binary Search · about 15 minutes
Asked at Google, Microsoft, Amazon, Bloomberg.
citations is sorted in ascending order; citations[i] is the number of citations of a researcher's i-th paper. The h-index is the largest h such that at least h papers have at least h citations each. Return it in O(log n) time.