https://leetcode.com/problems/contains-duplicate/

class Solution(object):
    def containsDuplicate(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        mydict = {}

        for i in xrange(len(nums)):

            if nums[i] in mydict:
                return True
            else:
                mydict[nums[i]] = i
        return False