Python3 93.52% (1052 ms)/100.00% (27.4 MB)
\nclass Solution:\n    def getStrongest(self, arr: List[int], k: int) -> List[int]:\n        arr.sort()\n        median = arr[len(arr) // 2] if len(arr) % 2 els
```\nclass Solution:\n    def getStrongest(self, arr: List[int], k: int) -> List[int]:\n        arr.sort()\n        median = arr[len(arr) // 2] if len(arr) % 2 else arr[len(arr) // 2 - 1]\n        left = 0\n        right = len(arr) - 1\n        ret = []\n        \n        \n        while (len(ret) != k):\n            left_value = abs(arr[left] - median)\n            right_value = abs(arr[right] - median)\n            \n            \n            if (right_value >= left_value):\n                ret.append(arr[right])\n                right -= 1\n            else:\n                ret.append(arr[left])\n                left += 1\n        \n        return ret   \n```
[]