力扣287.寻找重复数
class Solution { public: int findDuplicate(vector<int>& nums) { unordered_map<int,int>umap; int result=0; for(int i=0;i<nums.size();++i) { umap[nums[i]]++; } for(auto it= umap.begin();it != umap.end();++it ) { if( it ->second >= 2) { result=it->first; } } return result; } }; 标签:mapumap,map,遍历,int,result,unordered From: https://www.cnblogs.com/ysl99999/p/17340386.html