USING  HEAP.
Intuition\nWeight=abs(arr[i]-m), where m is median.\nIn this problem we need to return the vector ans . Giving the biggest elements having the biggest weight.\n
# Intuition\nWeight=abs(arr[i]-m), where m is median.\nIn this problem we need to return the vector ans . Giving the biggest elements having the biggest weight.\nMeans if an element have a bigger weight u have to store that element. But if u have a clash with element having equal weights , bigger element wins. \n\n# Approach\n1. First find the median.\n2. Make a map for assigning elements according to their weights.\n3. Map is formed with <int, heap> to return the biggest element first.\n4. Also for accessing the bigger weight first , we used a priority_queue(heap), which returns weight in decreasing order. \n\n# Complexity\n- Time complexity:\nO(N*logN), N for traversing throught each element of the array.\nand logN used by heapify algorithm(Arranging elements in decreasing order in heap in this question).\n\n- Space complexity:\nO(N*M), where N is the different weights.\nand M are the size of the heap assigned to different weights.\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        //find median\n        sort(arr.begin(),arr.end());\n        int n=arr.size();\n        int m=arr[(n-1)/2];\n\n        //using heap to find k strongest elements\n        priority_queue<int>heap;\n        unordered_map<int,priority_queue<int>>mapping;\n        for(int i=0;i<n;i++){\n            int weight=abs(arr[i]-m);\n            mapping[weight].push(arr[i]);\n            if(mapping[weight].size()==1)heap.push(weight);\n             }\n        vector<int>ans;\n        while(ans.size()<k){\n            int w=heap.top();\n             heap.pop();\n            while(ans.size()<k && !mapping[w].empty()){\n                int ele=mapping[w].top();\n                mapping[w].pop();\n                ans.push_back(ele);\n            }\n            }\n        \n        return ans;\n    }\n};\n```
['Hash Table', 'Heap (Priority Queue)', 'C++']