C++ | Custom Sort
\nclass Solution {\npublic:\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        sort(arr.begin(),arr.end());\n        int n=arr.size();\n        i
```\nclass Solution {\npublic:\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        sort(arr.begin(),arr.end());\n        int n=arr.size();\n        int m=arr[(n-1)/2];\n        sort( arr.begin( ), arr.end( ), [m]( const auto& x1, const auto& x2 )\n{\n   return abs(x1-m) == abs(x2-m) ? x1 > x2 : abs(x1-m) > abs(x2-m);\n});\n        vector<int> res(arr.begin(),arr.begin()+k);\n        return res;\n    }\n};\n```
[]