We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8901b1d commit 63dac45Copy full SHA for 63dac45
contains-duplicate/EstherKim97.py
@@ -0,0 +1,9 @@
1
+# Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
2
+
3
+def containsDuplicate(nums):
4
+ seen = set()
5
+ for num in nums:
6
+ if num in seen:
7
+ return True
8
+ seen.add(num)
9
+ return False
0 commit comments