Easy C++ Find the Winner of an Array Game
\nclass Solution {\npublic:\n    int getWinner(vector<int>& arr, int k) {\n        int lks=0,curr=0,i=1;\n        while(i<arr.size()){\n            if(arr[i]<ar
```\nclass Solution {\npublic:\n    int getWinner(vector<int>& arr, int k) {\n        int lks=0,curr=0,i=1;\n        while(i<arr.size()){\n            if(arr[i]<arr[curr]){\n                i+=1; lks+=1;\n                    if(lks==k) return arr[curr];\n            }\n            else{\n                curr=i; i+=1; lks=1;\n                    if(lks==k) return arr[curr];\n            }\n        }\n        return arr[curr];\n    }\n};\n```\n# Quick Explanation\n```\nStep1. Initialise 3 variables lks=0 ( num_of_turn_win) curr=0 ( current_poisition) i=1 ( next element)\nStep 2. Run a while loop ans check if curr element is greater then the next element or not.\nStep 3. If yes then increase the  win_turn and compare it with k if yes then return the curr element.\nStep4. Else replace curr with i and win_turn=1 and check it with k if yes then return the curr element.\nStep5. If not returned till now then finally return the curr element. as it is the max one.\n```
['C']