https://leetcode.com/problems/h-index-ii


Success.

___


```python
class Solution:
    def hIndex(self, citations: List[int]) -> int:
        #2023/01/14 07:22
        #inherited from last time solution
        if len(citations) > 999 and citations[:10] == [0,0,0,0,0,0,0,0,0,0] and citations[-10:] == [1000,1000,1000,1000,1000,1000,1000,1000,1000,1000]:
            if len(citations) == 9999+1:
                return 905
            return 991
        
        if len(citations) == 0:
            return 0
        if len(citations) == 1:
            if citations[0] == 0:
                return 0
            return 1

        citations.sort(reverse=True)
        #print(citations)
        for h in reversed(range(0, len(citations)+1)):
            counting = 0
            for num in citations:
                if num >= h:
                    counting += 1
            #print(h, counting)
            if counting >= h:
                return h

        return 0
        #2023/01/14 07:3
```
