Find the first item who's index more than value in sorted citations
Complexity T : O(nlog(n)) M : O(n)
class Solution:
def hIndex(self, citations):
"""
:type citations: List[int]
:rtype: int
"""
citations = sorted(citations,reverse = True) + [0]
for i, val in enumerate(citations):
if i >= val:
return i
return 0