Simple C++ Solution || Array || Simulation
Video Solution\nhttps://youtu.be/00bEdGLTyHY\n# Intuition\nJust assume winner as arr[0] and iterate through the array. And in each iteration compare the winner 
# Video Solution\nhttps://youtu.be/00bEdGLTyHY\n# Intuition\nJust assume winner as arr[0] and iterate through the array. And in each iteration compare the winner with the element of array and accordingly change the winner of array and also change the number of rounds won by our current winner.\nAlso in each iteration check whether match won by current winner is equal to k or not and if it is equal to k then return our current winner as final winner.\n\nFor better understanding please refer to video solution above.\n\n![image.png](https://assets.leetcode.com/users/images/8cc176b4-5e5c-4cb7-a067-88f9ab9919be_1699209710.593517.png)\n\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(1)$$\n\n**Please upvote if you liked !!!**\n\n# Code\n```\nint speedup = []{ios::sync_with_stdio(0); cin.tie(0); return 0;}();\nclass Solution {\npublic:\n    int getWinner(vector<int>& arr, int k) {\n        int winner=arr[0]; // current winner...\n        int winners_cnt=0; // rounds won by our current winner \n        for(int i=1;i<arr.size();i++){\n            if(winner>arr[i]){\n                // our current winner has won one more round\n                winners_cnt++;\n            }\n            else if(winner<arr[i]){\n                // our winner has been changed...\n                winner=arr[i];\n                winners_cnt=1;\n            }\n            if(winners_cnt==k){\n                // we have to check whether count of rounds won by current winner is k or not...\n                return winner;\n            }\n        }\n        return winner;\n    }\n};\n```
['Array', 'Simulation', 'C++']