C++ Easy 2 Pointers
C++ Simple and easy\n\nclass Solution {\npublic:\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        sort(arr.begin(), arr.end());\n        int me
C++ Simple and easy\n```\nclass Solution {\npublic:\n    vector<int> getStrongest(vector<int>& arr, int k) {\n        sort(arr.begin(), arr.end());\n        int median = arr[(arr.size() - 1) / 2];\n        vector<int> res;\n        int left = 0, right = arr.size() - 1;\n        while(left <= right && k--){\n            int leftRes = abs(arr[left] - median);\n            int rightRes = abs(arr[right] - median);\n            \n            if (leftRes > rightRes) {\n                res.push_back(arr[left]);\n                ++left;\n            }\n            else{\n                res.push_back(arr[right]);\n                --right;\n            }\n        }\n        return res;\n    }\n};\n```
['Two Pointers', 'C', 'Sorting']