```
bool containsDuplicate(vector<int>& nums) {
sort(nums.begin(),nums.end());
if(nums.size()==1){
return false;
}
for(int i=0,n=nums.size();i<n-1;i++) {
if(nums[i]==nums[i+1]) {
return true;
}
}
return false;
}
```

Sort first and compare consecutive numbers. it's O(nlgn) I think.