JAVA, JAVASCRIPT || 100% FASTER ||  4LINE CODE
PLEASE UPVOTE IF YOU LIKE IT\n# Complexity\n- Time complexity:O(N)\n- Space complexity:O(N)\n\n# Code\nJAVA\n\nclass Solution {\n    public int findMaxK(int[] a
**PLEASE UPVOTE IF YOU LIKE IT**\n# Complexity\n- Time complexity:O(N)\n- Space complexity:O(N)\n\n# Code\n**JAVA**\n```\nclass Solution {\n    public int findMaxK(int[] arr) {\n        HashMap<Integer, Integer> map = new HashMap<>();\n        int max = -1;\n        for (int i : arr) {\n            if (map.containsKey(i * -1)) {\n                max = Math.max(max, Math.abs(i));\n            }\n            map.put(i, 0);\n        }\n        return max;\n    }\n}\n```\n**C++**\n```\n#include <unordered_map>\n#include <algorithm>\n\nint findMaxK(int arr[], int size) {\n    std::unordered_map<int, int> map;\n    int max = -1;\n    for (int i = 0; i < size; i++) {\n        if (map.count(arr[i] * -1)) {\n            max = std::max(max, std::abs(arr[i]));\n        }\n        map[arr[i]] = 0;\n    }\n    return max;\n}\n```\n**JAVASCRIPT**\n```\nvar findMaxK = function(arr) {\n  const map = new Map()\n  let max = -1;\n  for(let i of arr){\n    if(map.has(i * -1)){\n      max = Math.max(max,Math.abs(i))\n    }\n    map.set(i, 0)\n  }\n  return max;\n};\n```
['Hash Table', 'C++', 'Java', 'JavaScript']