✅ C++ | Easy to understand | Hashing
\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        vector<int>ans;\n        unordered_map<int,int>m;\n        for(int i=0;i<n
```\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        vector<int>ans;\n        unordered_map<int,int>m;\n        for(int i=0;i<nums.size();i++)\n        {\n            m[nums[i]]++;\n        }\n        for(auto i:m)\n        {\n            int x=i.first;\n            if(m.find(x+1)==m.end() and m.find(x-1)==m.end() and i.second==1) ans.push_back(x);\n        }\n        return ans;\n    }\n};\n```
['C', 'C++']