Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

containsDuplicate Set Solution

class Solution(object):
    def containsDuplicate(self, nums):
        set_nums = set(nums)
        if len(set_nums) < len(nums):
            return True
        return False
Source by leetcode.com #
 
PREVIOUS NEXT
Tagged: #containsDuplicate #Set #Solution
ADD COMMENT
Topic
Name
4+4 =