def solution(citations): citations.sort(reverse=True) h_index = 0 for c in citations: if c > h_index: h_index += 1 else: break return h_index