JAVA TWO POINTERS VERY EASY TO UNDERSTAND
\nclass Solution {\n    public int[] getStrongest(int[] nums, int k) {\n        int[] res = new int[k];\n        Arrays.sort(nums);\n        int size = nums.len
```\nclass Solution {\n    public int[] getStrongest(int[] nums, int k) {\n        int[] res = new int[k];\n        Arrays.sort(nums);\n        int size = nums.length;\n        int m = (size - 1) / 2;\n        int median = nums[m];\n        int index = 0;\n        int left = 0, right = size - 1;\n        while (left <= right){\n            if ((nums[right] - median) >= (median - nums[left]))\n                res[index++] = nums[right--];\n            else\n                res[index++] = nums[left++];\n            if (index == k)\n                break;\n        }\n        return res;\n    }\n}\n```
['Java']