Easy to understand Java Solution. Two pointer approach.
\nclass Solution {\n    public int[] getStrongest(int[] arr, int k) {\n        \n        int first=0;\n\t\tint last=arr.length-1;\n\t\t\n\t\tint retStrongest[]=
```\nclass Solution {\n    public int[] getStrongest(int[] arr, int k) {\n        \n        int first=0;\n\t\tint last=arr.length-1;\n\t\t\n\t\tint retStrongest[]=new int[k];\n\t\tint index=0;\n\t\t\n\t\tArrays.sort(arr);\n\t\t\n\t   int median=arr[(arr.length-1)/2];\n\t   \n\t   \n\t   \n\t   for(int i=1;i<=k;i++)\n\t   {\n\t\t   if(Math.abs(arr[first]-median) > Math.abs(arr[last]-median) )\n\t\t   {\n\t\t\t   retStrongest[index]=arr[first];\n\t\t\t   first++;\n\t\t\t   index++;\n\t\t   }\n\t\t   \n\t\t   else if(Math.abs(arr[first]-median) < Math.abs(arr[last]-median) )\n\t\t   {\n\t\t\t   retStrongest[index]=arr[last];\n\t\t\t   last--;\n\t\t\t   index++;\n\t\t   }\n\t\t   \n\t\t   else if (Math.abs(arr[first]-median) == Math.abs(arr[last]-median) )\n\t\t   {\n\t\t\t   if(arr[first]>arr[last])\n\t\t\t   {\n\t\t\t\t   retStrongest[index]=arr[first];\n\t\t\t\t   first++;\n\t\t\t\t   index++;\n\t\t\t   }\n\t\t\t   else\n\t\t\t   {\n\t\t\t\t   retStrongest[index]=arr[last];\n\t\t\t\t   last--;\n\t\t\t\t   index++;\n\t\t\t   }\n\t\t   }\n\t\t   \n\t\t   \n\t\t   \n\t   }\n\t   \n\t   \n\t\t\n\t\treturn retStrongest;\n        \n    }\n}\n```
[]