```
class Solution(object):
def hIndex(self, citations):
"""
:type citations: List[int]
:rtype: int
"""
#sorted builtin takes nlogn time
citations=sorted(citations)
length=len(citations)
i=0
while i<length:
if citations[i]>=len(citations)-i:
return len(citations)-i
i+=1
return 0
```