标签:bool leetcode lse ica ++ i++ contain size vector
class Solution {
public:
map<int,int>m;
bool containsDuplicate(vector<int>& nums) {
for(int i=0;i<nums.size();i++)
{
if(m[nums[i]]!=0)
{
return true;
}
else
{
m[nums[i]]=1;
}
}
return false;
}
};
LeetCode 217. Contains Duplicate
标签:bool leetcode lse ica ++ i++ contain size vector
原文地址:https://www.cnblogs.com/dacc123/p/12344828.html