✅Easiest 2 Approaches first with ArrayList✔ and Second using HashMap with easiest Approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\n// class Solution {\n//     public List<Integer> findLonely(int[] arr) {\n//         ArrayList<Integer> l = new ArrayList<>();\n        \n//         for(int i = 0; i < arr.length; i++) {\n//             if(l.contains(arr[i]) || l.contains(arr[i] + 1) || l.contains(arr[i] - 1)) {\n//                 l.remove(Integer.valueOf(arr[i]));\n//                 l.remove(Integer.valueOf(arr[i] + 1));\n//                 l.remove(Integer.valueOf(arr[i] - 1));\n//             } else {\n//                 l.add(arr[i]);\n//             }\n//         }\n//         return l;\n//     }\n// }\nimport java.util.*;\n\nclass Solution {\n    public List<Integer> findLonely(int[] nums) {\n        HashMap<Integer, Integer> frequency = new HashMap<>();\n        for (int num : nums) {\n            frequency.put(num, frequency.getOrDefault(num, 0) + 1);\n        }\n        List<Integer> lonelyNumbers = new ArrayList<>();\n        for (int num : nums) {\n            if (frequency.get(num) == 1 &&  \n                !frequency.containsKey(num - 1) &&  \n                !frequency.containsKey(num + 1)) {\n                lonelyNumbers.add(num);\n            }\n        }\n\n        return lonelyNumbers;\n    }\n}\n\n```
['Java']