0%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| class Solution: def hIndex(self, citations: List[int]) -> int: def search_II(check)->int: left = 0 right = len(citations) while left<=right: mid = (left+right)>>1 if check(mid): left = mid+1 else: right = mid-1 return right def check(x)->bool: idx = bisect.bisect_left(citations,x) if len(citations)-idx >= x: return True return False return search_II(check)
|