class Solution { public: bool containsDuplicate(vector<int>& nums) { set<int> distinct; for(auto i:nums){ distinct.insert(i); } bool dupl = nums.size() != distinct.size(); return dupl; } };