A scientist’s Research Impact Score (similar to the h-index) is the largest number h such that the scientist has at least h papers, and each of those papers has been cited at least h times.
Write a function that, given an array citations where citations[i] is the number of times the i-th paper was cited, returns this score
Input: citations = [3,0,6,1,5]
Output: 3
Explanation:
There are 3 papers with at least 3 citations each (the papers with 3, 5, and 6 citations). So the research impact score is 3.
Input: citations = [1,3,1]
Output: 1
Explanation:
Only 1 paper has at least 1 citation. Thus, the research impact score is 1.
Accepted:
Submission: