2150. Find All Lonely Numbers in the Array You are given an integer array nums. A number x is lonely when it appears only once, and no adjacent numbers (i.e. x + 1 and x - 1) appear in the array. Return all lonely numbers in nums. You may return the answer in any order. 123456789101112131415class Solution {public: vector<int> findLonely(vector<int>& nums) { unordered_map<int, int> freq; for(auto& n : nums) freq[n]++; vector<int> res; for(int i = 0; i < nums.size(); i++) { if(freq[nums[i]] > 1) continue; if(freq.count(nums[i] - 1)) continue; if(freq.count(nums[i] + 1)) continue; res.push_back(nums[i]); } return res; }};