O(1) space
\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        nums.push_back(-10);\n        nums.push_back(1e6 + 10);\n        vector<in
```\nclass Solution {\npublic:\n    vector<int> findLonely(vector<int>& nums) {\n        nums.push_back(-10);\n        nums.push_back(1e6 + 10);\n        vector<int> result;\n        int n = nums.size();\n        sort(nums.begin(),nums.end());\n        for(int i=1;i<n-1;i++){\n            if(abs(nums[i]-nums[i-1])>1 && abs(nums[i+1]-nums[i])>1)\n                result.push_back(nums[i]);\n        }\n        return result;\n    }\n};\n```
['C', 'C++']