Easy code using hashmap
Code\ncpp []\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        unordered_map <int,int> mpp;\n        for (int i = 0 ; i < num
# Code\n```cpp []\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        unordered_map <int,int> mpp;\n        for (int i = 0 ; i < nums.size() ;i++)\n        mpp[nums[i]]++;\n        vector<int> lonely;\n        for (int i = 0 ; i < nums.size();i++)\n        {\n            if (mpp[nums[i]]==1 && !mpp[nums[i]+1] && !mpp[nums[i]-1])\n            lonely.push_back(nums[i]);\n        }\n        return lonely;\n    }\n};\n```
['C++']