Python solution incorrect answer

  • -1

    Can you help me why it is incorrect answer?


    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.