simple cpp solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\no(nlogn)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\no(n)\n# Code\n```\nclass Solution {\npublic:\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        vector<pair<int,int>>v;\n        int sum=0,n=arr.size();\n        sort(arr.begin(),arr.end());\n        int median=arr[(n-1)/2];\n        for(int i=0;i<arr.size();i++)\n        {\n            v.push_back({abs(arr[i]-median),arr[i]});\n        }\n        sort(v.begin(),v.end());\n        reverse(v.begin(),v.end());\n        vector<int>ans;\n        for(int i=0;i<k;i++)\n        {\n            ans.push_back(v[i].second);\n        }\n        return ans;\n\n    }\n};\n```\n\n![upvote.jpg](https://assets.leetcode.com/users/images/ac5baf5d-2804-447b-b09e-5ff966529a4b_1675661178.3177938.jpeg)\n\n
['Array', 'C++']