huh? TLE when I originally submitted nlogk solution in contest, which now passes and beats 100%
I posted below O(nlogk) solution during contest and it gave me "Time Limit Exceeded". Now after looking at all the solutions here which are also nlogk, I resubm
I posted below O(nlogk) solution during contest and it gave me "Time Limit Exceeded". Now after looking at all the solutions here which are also nlogk, I resubmitted the same code again and now it passes beating 100% submissions for memory and 50% submissions for time complexity. \n\nWhat does this even mean??\n\n\n```\nclass Solution {\n    int median;\n    struct compare {\n        bool operator()(const pair<int, int> &x, const pair<int, int> &y) {\n            if(x.second == y.second)\n                return x.first > y.first;\n            return x.second > y.second;\n        }  \n    };\npublic:\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        priority_queue<int, vector<int>> minMedian;\n        int size = arr.size();\n        int n = (size - 1)/2 + 1;\n        for(int i = 0 ; i < arr.size(); ++i) {\n            minMedian.push(arr[i]);\n            if(minMedian.size() > n) {\n                minMedian.pop();\n            }\n        }\n        median = minMedian.top();\n        priority_queue<pair<int, int>, vector<pair<int, int>>, compare> minHeap;\n        for(int i = 0 ; i < arr.size(); ++i) {\n            int temp = arr[i];\n            arr[i] = abs(arr[i] - median);\n            minHeap.push({temp, arr[i]});\n            if(minHeap.size() > k) {\n                minHeap.pop();\n            }\n        }\n        int i = k - 1;\n        vector<int> output(k);\n        while(i >= 0 && !minHeap.empty()) {\n            output[i] = minHeap.top().first;\n            minHeap.pop();\n            i--;\n        }\n        \n        return output;\n    }\n};\n```
[]