c++ || bruteforce with hasing || T.C. = O(N)
// Bruteforce => T.C. = TLE\n//Bruteforce + hashing =>  T.C. = O(N)\n\n\tvector findLonely(vector& nums) {\n\t\t\t\tvector ans;\n\t\t\t\tint size = nums.size();
// Bruteforce => T.C. = TLE\n//Bruteforce + hashing =>  T.C. = O(N)\n\n\tvector<int> findLonely(vector<int>& nums) {\n\t\t\t\tvector<int> ans;\n\t\t\t\tint size = nums.size();\n        \n        vector<int> cnt(1e6+10,0);\n        for(int i = 0;i<size;i++)\n        {\n            cnt[nums[i]]++;\n        }\n        \n        for(int i = 0; i < size; i++)\n        {\n            if(nums[i] == 0)\n            {\n                if(cnt[0] == 1 and cnt[1] == 0) ans.push_back(nums[i]);\n            }\n            else if(cnt[nums[i]] == 1)\n            {\n                if(cnt[nums[i]-1] == 0 and cnt[nums[i]+1] == 0)\n                    ans.push_back(nums[i]);\n            }\n            else continue;                                                                                                       \n                                                                                                                   \n        }\n        return ans;\n    }
['C']