cites[i] is how many times a researcher's paper i has been cited; the list is sorted in non-decreasing order.
The author's impact score is the largest number h such that the author has at least h papers, each cited at least h times.
Return the impact score. Your solution must run in logarithmic time.cites=[1, 2, 2, 5, 8, 10] → 3
The last three papers have at least 3 citations each (5, 8, 10), but there are not four papers with 4 or more. The answer is 3.
cites=[0, 3, 3, 3] → 3
Three papers with 3 citations give an answer of 3; there are not four papers with 4 or more.
cites=[0] → 0
cites is sorted in non-decreasing ordercites=[1, 2, 2, 5, 8, 10]
3
Run checks the first 3 tests in your browser. Submit checks all 81 tests on the server, hidden ones included.