Java Solution
\nclass Solution {\n    \n    public int[] getStrongest(int[] arr, int k) {\n        \n        int i = 0, j = arr.length - 1, l = 0;\n        if (j == -1) retur
```\nclass Solution {\n    \n    public int[] getStrongest(int[] arr, int k) {\n        \n        int i = 0, j = arr.length - 1, l = 0;\n        if (j == -1) return new int[0];\n        Arrays.sort(arr);\n        int median = arr[j / 2];\n        int[] res = new int[k];\n        while (l < k){\n            if (median - arr[i] > arr[j] - median)\n                res[l++] = arr[i++];\n            else\n                res[l++] = arr[j--];\n        }\n        return res;\n    }\n}\n```
[]