class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
if (nums.size() == 0) return false;
sort(nums.begin(), nums.end());
int cur = -1;
for(int i = 0; i < nums.size(); i++) {
if (cur != nums[i]) {
cur = nums[i];
} else {
return true;
}
}
return false;
}
};