C++  K strongest values in the array
\nif like it upvote.......\u2661\n\n\nvector getStrongest(vector& arr, int k) {\n        vectorans;\n        sort(arr.begin(),arr.end());\n        int mid=arr[(
\n**if like it upvote.......\u2661**\n\n\nvector<int> getStrongest(vector<int>& arr, int k) {\n        vector<int>ans;\n        sort(arr.begin(),arr.end());\n        int mid=arr[(arr.size()-1)/2];\n        int s=0;\n        int e=arr.size()-1;\n        while(s<=e)\n        {\n            if(abs(arr[s]-mid)>abs(arr[e]-mid))\n            {\n                ans.push_back(arr[s]);\n                s++;\n            }\n            else\n            {\n                ans.push_back(arr[e]);\n                e--;\n            }\n            if(ans.size()==k)\n            {\n                break;\n            }\n        }\n        return ans;\n    }
['Two Pointers', 'C', 'Sorting']