[LeetCode] 274. H-Index
意外的简单。
class Solution:
def hIndex(self, citations: List[int]) -> int:
sorted_list = sorted(citations, reverse=True)
ret = 0
for i,element in enumerate(sorted_list[:1000]):
curr = min(i+1, element)
if curr > ret:
ret = curr
return ret