File tree 2 files changed +17
-0
lines changed 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 30
30
67|[ Add Binary] ( ./0067-add-binary.js ) |Easy|
31
31
151|[ Reverse Words in a String] ( ./0151-reverse-words-in-a-string.js ) |Medium|
32
32
152|[ Maximum Product Subarray] ( ./0152-maximum-product-subarray.js ) |Medium|
33
+ 217|[ Contains Duplicate] ( ./0217-contains-duplicate.js ) |Easy|
33
34
226|[ Invert Binary Tree] ( ./0226-invert-binary-tree.js ) |Easy|
34
35
263|[ Ugly Number] ( ./0263-ugly-number.js ) |Easy|
35
36
264|[ Ugly Number II] ( ./0264-ugly-number-ii.js ) |Medium|
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 217. Contains Duplicate
3
+ * https://leetcode.com/problems/contains-duplicate/
4
+ * Difficulty: Easy
5
+ *
6
+ * Given an integer array `nums`, return `true` if any value appears at least
7
+ * twice in the array, and return `false` if every element is distinct.
8
+ */
9
+
10
+ /**
11
+ * @param {number[] } nums
12
+ * @return {boolean }
13
+ */
14
+ var containsDuplicate = function ( nums ) {
15
+ return new Set ( nums ) . size !== nums . length ;
16
+ } ;
You can’t perform that action at this time.
0 commit comments