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


Success

___


```python
class Solution:
    def hIndex(self, citations: List[int]) -> int:
        #2023/01/12 09:05
        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/12 09:38
```
