Calculate h-index
Your task
A researcher's h-index is the largest h such that they have at least h papers each cited at least h times. Given an array citations where citations[i] is the citation count of the i-th paper, return the h-index. Array length up to 5000; citation counts are non-negative.
Examples
h_index(citations: list[int]) -> intExample 1
Input
h_index([3, 0, 6, 1, 5])Output
3