Skip to content

Commit

Permalink
Merge pull request #63 from gaurav-312/main
Browse files Browse the repository at this point in the history
created solution of Q217
  • Loading branch information
prathamesh-borse authored Oct 8, 2021
2 parents 1c4f634 + 4392b10 commit fbc784d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions leetcode/217_contains_duplicate.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
sort(nums.begin(),nums.end());
for (int i=0;i<nums.size()-1;++i){
if (nums[i]==nums[i+1]) return true;
}
return false;
}
};

0 comments on commit fbc784d

Please sign in to comment.