class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
return set<int>(nums.begin(), nums.end()).size() < nums.size();
}
};
C++ solution. simply one line.

Integers in set<int> are all instinct.So if nums.size() > set<int>.size(),it means at least one integer is duplicate.