Skip to content

Commit

Permalink
Create containsduplicates.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rerichardjr authored Sep 26, 2023
1 parent b1eb9a0 commit 3c9c839
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions containsduplicates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
results = set()
for k in nums:
if k in results:
return True
results.add(k)
return False

0 comments on commit 3c9c839

Please sign in to comment.