标签:重复 tor bre ret contains contain turn flag vector
class Solution { public: bool containsDuplicate(vector<int>& nums) { set<int> duplicateSet; bool flag = false; for(auto num: nums) { if (duplicateSet.find(num) == duplicateSet.end()) { duplicateSet.insert(num); } else { flag = true; break; } } return flag; } };
标签:重复 tor bre ret contains contain turn flag vector
原文地址:https://www.cnblogs.com/randyniu/p/9376897.html