Custom Sorting || PAIRS || EASY || CPP
\nclass Solution {\npublic:\n    static bool comp(pair<int,int> &A,pair<int,int> &B){\n        if(A.first>B.first) return true;\n        else if(A.first==B.firs
```\nclass Solution {\npublic:\n    static bool comp(pair<int,int> &A,pair<int,int> &B){\n        if(A.first>B.first) return true;\n        else if(A.first==B.first) return A.second>B.second;\n        return false;\n    }\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        vector<int> P=arr;\n        sort(P.begin(),P.end());\n        int m=(P[(P.size()-1)/2]);     \n        vector<pair<int,int>> Q;\n        for(int i=0;i<arr.size();i++){\n            Q.push_back({abs(arr[i]-m),arr[i]});\n        }\n        sort(Q.begin(),Q.end(),comp);\n        P.clear();\n        for(int i=0;i<Q.size() && i<k;i++){\n            P.push_back(Q[i].second);\n        }\n        return P;\n    }\n};\n```
['Sorting', 'C++']