A researcher's impact score is the largest integer h such that at least h of their papers have at least h citations each.
Given the list citations (one entry per paper), return the impact score.
Examples
Input: citations = [8, 2, 4, 0, 11, 4]
Output: 4
Explanation: Four papers (8, 4, 11, 4) have at least 4 citations, but only two have at least 5.
Input: citations = [0, 4, 1]
Output: 1
Constraints
0 <= len(citations) <= 10**50 <= citations[i] <= 10**6- Target complexity: O(n log n).
Goals
- Translate a threshold definition into a scan over a sorted list
- Relate a value to its position in descending order
- Return the largest threshold that still holds