274. H-Index
Last updated
Last updated
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.
According to the : "A scientist has index h if h of his/her N papers have at least h citations each, and the other N − h papers have no more than h citations each."
Example:
Note: If there are several possible values for h, the maximum one is taken as the h-index.
O(nlog(n)) time O(1) space 从小到大排序后, 从最大的citation开始往下数。 一旦citation的数量小于你现在路过的总paper数,就退出。