python O(nlogn), sort
\nclass Solution:\n    def getStrongest(self, arr: List[int], k: int) -> List[int]:\n        n = len(arr)\n        m = (n - 1) // 2\n        sort_arr = sorted(a
```\nclass Solution:\n    def getStrongest(self, arr: List[int], k: int) -> List[int]:\n        n = len(arr)\n        m = (n - 1) // 2\n        sort_arr = sorted(arr)\n        med = sort_arr[m]\n        \n        A = {}\n        for x in arr:\n            dist = abs(x - med)\n            if dist in A:\n                A[dist].append(x)\n            else:\n                A[dist] = [x]\n        \n        res = []\n        count = 0 \n        for dist in sorted(A.keys(), reverse = True):\n            val = sorted(A[dist], reverse=True)\n            for x in val:\n                if count < k:\n                    res.append(x)\n                    count += 1\n        return res\n            \n            \n\n\n```
['Python']