Skip to content

Commit a199169

Browse files
Time: 40 ms (35.73%), Space: 22.5 MB (7.22%) - LeetHub
1 parent f596850 commit a199169

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Solution {
2+
public:
3+
bool containsDuplicate(vector<int>& nums) {
4+
5+
set <int> dup;
6+
dup=set(nums.begin(),nums.end());
7+
8+
if(nums.size()>dup.size())
9+
{
10+
return true;
11+
}
12+
else
13+
return false;
14+
15+
16+
}
17+
};

0 commit comments

Comments
 (0)