Java Solution
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:O(N log N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n\n# Code\n```java []\nclass Solution {\n    public int[] getStrongest(int[] arr, int k) {\n        //find the median\n        Arrays.sort(arr);\n        int median = (arr.length-1)/2;\n        //intialise a max heap so that it stores the maximum absolute difference element \n        //if difference is same it should store max element at top followed by min element\n        PriorityQueue<int[]> pq = new PriorityQueue<>((a,b)->{\n            int diffA= Math.abs(a[0]-arr[median]);\n            int diffB= Math.abs(b[0]-arr[median]);\n            if(diffA!=diffB){\n                return Integer.compare(diffB,diffA);\n            }else{\n                return Integer.compare(b[0],a[0]);\n            }\n        });\n        for(int i:arr){\n            pq.add(new int[]{i});\n        }\n        int[] res = new int[k];\n        int t=0;\n        while(k!=0){\n            int [] top=pq.poll();\n            res[t]=top[0];\n            t++;\n            k--;\n        }\n        return res;\n    }\n}\n```
['Array', 'Sorting', 'Heap (Priority Queue)', 'Java']