class Solution(object):
    def containsDuplicate(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        dict = {}
        for num in nums:
            if dict.get(num) == num :
                return True
            else:
                dict[num]=num
        return False

    def containsDuplicateOptmize(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        if not nums or len(nums)==0: return False
        st = set()
        for num in nums: st.add(num)
        # expression returns true or false (set size < arr)
        return (len(st)<len(nums))  
6ad28c5df0a68708d120bc396e568370eaa7713b
<mask token>

class Solution(object):
    <mask token>
    <mask token>

class Solution(object):
    <mask token>

    def containsDuplicateOptmize(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        if not nums or len(nums) == 0:
            return False
        st = set()
        for num in nums:
            st.add(num)
        return len(st) < len(nums)

class Solution(object):

    def containsDuplicate(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        dict = {}
        for num in nums:
            if dict.get(num) == num:
                return True
            else:
                dict[num] = num
        return False

    def containsDuplicateOptmize(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        if not nums or len(nums) == 0:
            return False
        st = set()
        for num in nums:
            st.add(num)
        return len(st) < len(nums)

class Solution(object):
    def containsDuplicate(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        dict = {}
        for num in nums:
            if dict.get(num) == num :
                return True
            else:
                dict[num]=num
        return False

    def containsDuplicateOptmize(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        if not nums or len(nums)==0: return False
        st = set()
        for num in nums: st.add(num)
        # expression returns true or false (set size < arr)
        return (len(st)<len(nums))  