Implement a H-Index score for an author
Anonymous
class Solution(object): def hIndex(self, citations): """ :type citations: List[int] :rtype: int """ ssum = 0 sz = len(citations) mp = [0]*(sz+1) for ci in citations: mp[min(sz,ci)] +=1 for i in range(sz,-1,-1): ssum += mp[i] if ssum>=i: return i return 0
Check out your Company Bowl for anonymous work chats.