C++ solution || using HashMap
\nclass Solution \n{\npublic:\n    vector<int> findLonely(vector<int>& nums) \n    {\n        int i,s;\n        s=nums.size();\n        map <int,int >m;\n      
```\nclass Solution \n{\npublic:\n    vector<int> findLonely(vector<int>& nums) \n    {\n        int i,s;\n        s=nums.size();\n        map <int,int >m;\n        vector <int> v;\n        for(i=0;i<s;i++)\n        {\n            m[nums[i]]++;\n        }\n        for(auto it:m)\n        {        \n            if(it.second==1)\n            {          \n                auto iprev=m.find(it.first-1);\n                auto inext=m.find(it.first+1);\n                if(iprev==m.end() && inext==m.end())\n                    v.push_back(it.first);\n            }\n        }\n        return v;\n    }\n};\n```
[]