原题:
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.
***********************我是分割线***********************
class Solution {
public:
bool containsDuplicate(vector& nums) {
set coun;
for(auto i: nums)
{
bool check=coun.insert(i).second;
if(!check)
return true;
}
return false;
}
};