diff --git a/Top150Interview/217_Contains_Duplicate.py b/Top150Interview/217_Contains_Duplicate.py index e69de29..2800c4c 100644 --- a/Top150Interview/217_Contains_Duplicate.py +++ b/Top150Interview/217_Contains_Duplicate.py @@ -0,0 +1,15 @@ +def containsDuplicate(nums): + """ + :type nums: List[int] + :rtype: bool + """ + dupes = [] + for x in nums: + if x not in dupes: + dupes.append(x) + else: + return True + return False + + +containsDuplicate([1,2,3,1]) \ No newline at end of file