C++ || Hashmap || Clean & Easy
\n\nclass Solution {\npublic:\n    vector findLonely(vector& nums) {\n        unordered_mapm;\n        vectorans;\n        for(int i=0;i<nums.size();i++){\n    
```\n\n```class Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        unordered_map<int,int>m;\n        vector<int>ans;\n        for(int i=0;i<nums.size();i++){\n            m[nums[i]]++;\n        }\n        for(int i=0;i<nums.size();i++){\n             if(m[nums[i]] == 1 && m.count(nums[i] - 1) == 0 && m.count(nums[i] + 1) == 0){\n                ans.push_back(nums[i]);\n        }\n      }\n        return ans;\n    }\n};\n\nfeel free to ask your doubts :)\nand pls upvote if it was helpful :)
['C']