C++ O(n) Solution
```\nclass Solution {\npublic:\n    int getWinner(vector& arr, int k) {\n        int index = 1;\n        int count = 1;\n        int max = arr[0];\n        whil
```\nclass Solution {\npublic:\n    int getWinner(vector<int>& arr, int k) {\n        int index = 1;\n        int count = 1;\n        int max = arr[0];\n        while(index < arr.size()){\n            if(max < arr[index]){\n                max = arr[index];\n                count = 1;\n            }\n            if(count >= k )\n                break;\n            count++;\n            index++;\n        }\n        return max;\n    }\n};
[]