Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- bool containsDuplicate(vector<int>& nums) {
- set<int>s;
- for(int i=0;i<nums.size();i++)
- {
- s.insert(nums[i]);
- }
- if(s.size()==nums.size()) return false;
- else return true;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement