原文链接:https://leetcode-cn.com/problems/shu-zu-zhong-zhong-fu-de-shu-zi-lcof/
int findRepeatNumber(vector<int>& nums) {
map<int,int> mp;
for(auto x:nums){
if(mp.count(x)) return x;
else mp[x]++;
}
return 0;
}
原文链接:https://leetcode-cn.com/problems/shu-zu-zhong-zhong-fu-de-shu-zi-lcof/
int findRepeatNumber(vector<int>& nums) {
map<int,int> mp;
for(auto x:nums){
if(mp.count(x)) return x;
else mp[x]++;
}
return 0;
}