C++ Solution -Using Priority Queue
```\nclass Solution {\npublic:\n    struct compare{\n        bool operator()(pair p1,pair p2){\n            if (p1.first==p2.first){\n                return p1.
```\nclass Solution {\npublic:\n    struct compare{\n        bool operator()(pair<int,int> p1,pair<int,int> p2){\n            if (p1.first==p2.first){\n                return p1.second<p2.second;\n            }\n            else{\n                return p1.first<p2.first;\n            }\n        }\n    };\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        priority_queue<pair<int,int>,vector<pair<int,int>>,compare> pq;\n        vector<int> v1;\n        sort(arr.begin(),arr.end());\n        int median= arr.size()%2!=0 ? arr[(arr.size()/2)] :arr[arr.size()/2-1];\n        for (int i=0;i<arr.size();i++){\n            pq.push({abs(arr[i]-median),arr[i]});\n        }\n        while (!pq.empty() && k--){\n            v1.push_back(pq.top().second);\n            pq.pop();\n        }\n        return v1;\n    }\n};
[]