C++ simple O(N) One Pass
```\nclass Solution {\n    \npublic:\n    int getWinner(vector& arr, int k) {\n        \n        int n=arr.size();\n      \n       //win --current winner index\
```\nclass Solution {\n    \npublic:\n    int getWinner(vector<int>& arr, int k) {\n        \n        int n=arr.size();\n      \n       //win --current winner index\n        int win=0;\n        //count--how many times winner   "win" has won up to now\n        int count=0;\n        for(int i=1;i<n;++i){\n           \n            if(arr[i]>arr[win]){\n                \n                win=i;\n                //count 1 as  i already own one now\n                count=1;\n            }\n            else{\n                //prev_winner wins again\n                count++;\n                \n            }\n            if(count==k)return arr[win];\n            \n        }\n        \n        //after complete traversal of array last winner is the maximum element\n        //whatever the remaining k he is going to win\n        return arr[win];\n    }\n};
[]