Java Custom Sort [easy]
\n  public static int[] getStrongest(int[] arr, int k) {\n    Arrays.sort(arr);\n    int med = arr[((arr.length - 1) / 2)];\n    int[] kStrongest = new int[k];\
```\n  public static int[] getStrongest(int[] arr, int k) {\n    Arrays.sort(arr);\n    int med = arr[((arr.length - 1) / 2)];\n    int[] kStrongest = new int[k];\n    ArrayList<Integer> ns = new ArrayList<>();\n    for (int f : arr) ns.add(f);// please comment if any better way to do this [copying int[] into ArrayList]\n    ns.sort((i1, i2) -> {\n      int diff = Math.abs(i2 - med) - Math.abs(i1 - med);\n      if (diff == 0) {\n        return i2 - i1;\n      }\n      return diff;\n    });\n    for (int i = 0; i < k; i++) {\n      kStrongest[i] = ns.get(i);\n    }\n    return kStrongest;\n  }\n```
['Sorting', 'Java']