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 ee1ad8e commit a3b23afCopy full SHA for a3b23af
contains-duplicate/Raft.py
@@ -0,0 +1,10 @@
1
+class Solution:
2
+ def containsDuplicate(self, nums: List[int]) -> bool:
3
+ appeared = defaultdict(int)
4
+ for n in nums:
5
+ if appeared[n] > 0:
6
+ return True
7
+ appeared[n] += 1
8
+
9
+ return False
10
0 commit comments