This solution is even more straight then you.
Intuition\n Describe your first thoughts on how to solve this problem. \nHEY GUYS PLS UPVOTE PPL.\n# Approach\n Describe your approach to solving the problem. \
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nHEY GUYS PLS UPVOTE PPL.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n\n1. **Initializing Variables:**\n   - `HashSet<Integer> hm = new HashSet<>()`: Creates a HashSet named `hm` to store the unique numbers encountered while iterating through the `nums` array.\n   - `int ans = -1`: Initializes a variable `ans` to store the maximum absolute difference found so far. It\'s initially set to -1 to indicate no such difference has been found yet.\n\n2. **Iterating Through the Array:**\n   - The `for` loop iterates through each element (`nums[i]`) in the `nums` array.\n\n3. **Adding to HashSet and Checking for Negative Counterpart:**\n   - `hm.add(nums[i])`: Attempts to add the current element (`nums[i]`) to the `HashSet` `hm`. If it\'s a new element, it gets added, and the method returns `true`.\n   - `if (hm.contains(-nums[i]))`: Checks if the negative of the current element (`-nums[i]`) already exists in the `HashSet` `hm`.\n     - If `hm.contains(-nums[i])` returns `true`, it means both the number and its negative counterpart have been encountered in the array. This signifies a potential absolute difference.\n\n4. **Updating Maximum Difference:**\n   - `ans = Math.max(ans, Math.abs(nums[i]))`:\n     - This line calculates the absolute value (positive distance from zero) of the current element `nums[i]` using `Math.abs(nums[i])`.\n     - It then uses the `Math.max` function to compare this absolute value with the previously found `ans` (maximum difference).\n     - The larger value between the current absolute value and `ans` is stored back in `ans`. This ensures `ans` always holds the maximum absolute difference found so far.\n\n5. **Returning the Result:**\n   - `return ans`: After iterating through the entire array, `ans` will hold the maximum absolute difference (or -1 if no such difference exists). The code returns this value.\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(N)\n\n# Code\n```\nclass Solution {\n    public int findMaxK(int[] nums) {\n        HashSet<Integer> hm=new HashSet<>();\n        int ans=-1;\n        for(int i=0;i<nums.length;i++){\n            hm.add(nums[i]);\n            if(hm.contains(-nums[i])){\n                ans=Math.max(ans,Math.abs(nums[i]));\n            }\n        }\n        return ans;\n        \n    }\n}\n```
['Hash Table', 'Java']