very easy Map based solution.
class Solution {\npublic:\n    vector findLonely(vector& nums) {\n        vectorans;\n        int n=nums.size();\n        mapmp;\n        for(int i=0;i<n;i++){\
class Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        vector<int>ans;\n        int n=nums.size();\n        map<int,int>mp;\n        for(int i=0;i<n;i++){\n            mp[nums[i]]++;\n        }\n        for(int i=0;i<n;i++){\n            if(mp.find(nums[i]+1)==mp.end() &&mp.find(nums[i]-1)==mp.end() &&mp[nums[i]]==1){\n                ans.push_back(nums[i]);\n            }\n        }\n        return ans;\n    }\n};
['C']