C++ STL but no sorting O(N)
\n\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        const int median = (arr.size()-1)/2;\n        nth_element(begin(arr), begin(arr)+median, en
```\n\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        const int median = (arr.size()-1)/2;\n        nth_element(begin(arr), begin(arr)+median, end(arr));  // find median, O(N)\n        const int M = *(begin(arr)+median);\n        // find strongest K elements\n        nth_element(begin(arr), begin(arr)+k-1, end(arr), [M](const auto& I, const auto& J) {\n            int strength1=abs(I-M);\n            int strength2=abs(J-M);\n            return strength1==strength2? I>J : strength1 > strength2; });\n        arr.resize(k);  // reuse as return value\n        return arr;\n    }\n```
[]