class Solution {
public:
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
*
* @param array int整型vector
* @return int整型vector
*/
vector<int> FindNumsAppearOnce(vector<int>& array) {
sort(array.begin(), array.end());
map<int, int>mp;
vector<int>ret;
for (auto n : array) {
if (mp.find(n) == mp.end()) {
mp[n] = 1;
} else {
mp[n] = 2;
}
}
map<int, int> :: iterator it;
for (it = mp.begin(); it != mp.end(); it++) {
if (it->second == 1) {
ret.push_back(it->first);
}
}
return ret;
// write code here
}
};