C++ || Hashmap
\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        vector<int> res;\n        vector<int> hash(1e6+2,0);\n        for(auto &i:
```\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        vector<int> res;\n        vector<int> hash(1e6+2,0);\n        for(auto &i:nums)hash[i]++;\n        for(auto &i:nums){\n            if(i)\n            { if(hash[i] == 1 && !hash[i+1] && !hash[i-1])\n                    res.push_back(i);\n            }\n            else if(hash[0] == 1 && !hash[1])res.push_back(i);\n            \n        }\n        return res;\n    }\n};\n```
['C']