python is very easy by using counter


  • 1
    T
    from collections import Counter
            L = Counter(nums)
            for i in range(len(nums)):
                if L[nums[i]] >= 2:
                    return True
            return False
    

Log in to reply
 

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