using STL
\nclass Solution {\npublic:\n    int median = 0;\n  \n    vector<int> getStrongest(vector<int>& arr, int k) {\n        int n = arr.size();\n        sort(arr.beg
```\nclass Solution {\npublic:\n    int median = 0;\n  \n    vector<int> getStrongest(vector<int>& arr, int k) {\n        int n = arr.size();\n        sort(arr.begin(),arr.end());\n          median = arr[(n-1)/2];\n        vector<pair<int,int>>pq;\n        for(int i = 0;i<arr.size();i++)\n        {\n            pq.push_back(make_pair(arr[i],abs(arr[i]-median)));\n        }\n        sort(pq.begin(),pq.end(),[](pair<int,int> a,pair<int,int> b){\n           if(a.second==b.second) return a.first > b.first;\n            else return a.second>b.second;\n            });\n        vector<int>result;\n        for(auto i:pq)\n        {\n            if(k == 0)\n              break;\n            result.push_back(i.first);\n            k--;\n        }\n        return result;\n    }\n};\n```
[]