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 16009a3 commit 2d511d5Copy full SHA for 2d511d5
contains-duplicate/soobing.ts
@@ -0,0 +1,10 @@
1
+function containsDuplicate(nums: number[]): boolean {
2
+ const map = new Map();
3
+ for (let i = 0; i < nums.length; i++) {
4
+ if (map.get(nums[i])) {
5
+ return true;
6
+ } else map.set(nums[i], 1);
7
+ }
8
+
9
+ return false;
10
+}
0 commit comments