C++ solution beats 95% speed
\nvector<int> getStrongest(vector<int>& arr, int k) {\n        if(arr.size()<2) return arr;\n        sort(arr.begin(),arr.end());\n        int med=arr[(arr.size
```\nvector<int> getStrongest(vector<int>& arr, int k) {\n        if(arr.size()<2) return arr;\n        sort(arr.begin(),arr.end());\n        int med=arr[(arr.size()-1)/2];\n        int left=0,right=arr.size()-1;\n        vector<int> answer;\n        while(k>0){\n            int val_l=abs(arr[left]-med);\n            int val_r=abs(arr[right]-med);\n            if(val_l>val_r){\n                answer.push_back(arr[left]);\n                ++left;\n            }\n            else{\n                answer.push_back(arr[right]);\n                --right;\n            }\n            --k;\n        }\n        return answer;\n    }\n```
[]