HashMap solution || Easy to understand
Intuition\n- If array has single element, It will be the winner for all k\'s\n\n- if mx if greater than current element,it will the winner, so increase its win 
# Intuition\n- If array has single element, It will be the winner for all k\'s\n\n- if mx if greater than current element,it will the winner, so increase its win count in map\n\n - if current element if greater than mx,  it will the winner, so increase its win count in map and update mx as current element\nAt any point of time, if elements win count equals to k, return it as answer\n\n- After one traversal of array, maximum element will be at first position of array and it will be the winner for every move we perform afterwards. Hence ultimately it will the answer for every k.\n\n\n# Code\n```\nclass Solution {\npublic:\n    int getWinner(vector<int>& arr, int k) {\n        int n = arr.size();\n\n        if(n < 2) return arr[0];\n        int mx = arr[0];\n        unordered_map<int, int> mp;\n\n        for(int i = 1; i < n; i++)\n        {\n            if(mx >= arr[i]){\n                mp[mx]++;\n            }\n            else{\n                mx = arr[i];\n                mp[mx]++;\n            }\n            if(mp[mx] == k)\n                return mx;\n        }\n        return mx;\n    }\n};\n```
['Ordered Map', 'C++']