99% beat me,but it is AC,oh my god!


  • 0
    Z

    def missingNumber(self, nums):
    """
    :type nums: List[int]
    :rtype: int
    """
    from collections import Counter
    l=range(len(nums)+1)
    L=Counter(l)
    Nums=Counter(nums)
    return (list(L-Nums))[0]


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.