题目

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;
    }
};

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-08-10
  • 2021-12-06
  • 2022-02-11
猜你喜欢
  • 2021-09-12
  • 2021-12-20
  • 2021-08-24
  • 2021-12-11
相关资源
相似解决方案