LeetCode #274: H-Index
β’ 31 words β’ 1 min β’ updated
python
class Solution:
def hIndex(self, citations: List[int]) -> int:
citations.sort(reverse=True)
h = 0
while h < len(citations):
if h < citations[h]:
h += 1
else:
break
return h