Python solution incorrect answer


  • -1
    S

    Can you help me why it is incorrect answer?

    Thanks!

    class Solution(object):
        def containsDuplicate(self, nums):
            """
            :type nums: List[int]
            :rtype: bool
            """
            return bool([n for n in set(nums) if nums.count(n)>1])
    
    

Log in to reply
 

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