From 0aa18854575255fa980496aff049c46b9c18f75d Mon Sep 17 00:00:00 2001 From: ImAlpha Date: Fri, 21 Jul 2023 16:55:07 -0700 Subject: [PATCH] finished 70/74 test cases, time limit exceeded --- Top150Interview/217_Contains_Duplicate.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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