Imagine you're a researcher who has published several papers, and you want to measure your academic impact using the prestigious H-Index metric.
Given an array citations where citations[i] represents the number of citations your i-th paper has received, calculate your H-Index.
The H-Index is defined as: The maximum value h such that you have published at least h papers that have each been cited at least h times.
Example: If you have papers with citations [3, 0, 6, 1, 5], your H-Index is 3 because you have 3 papers with at least 3 citations each (papers with 3, 6, and 5 citations), but you don't have 4 papers with at least 4 citations each.
Input & Output
Constraints
- n == citations.length
- 1 โค n โค 5000
- 0 โค citations[i] โค 1000