JAVA SOLUTION 0MS 100.00% Better Solution
Time Complexity  :      O(N)\nSpace Complexity :     O(1)\n\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        int n = arr.length;\n      
Time Complexity  :      O(N)\nSpace Complexity :     O(1)\n\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        int n = arr.length;\n        if(k>=n){\n            int max = arr[0];\n            for(int i:arr){\n                if(max<i)max=i;\n            }\n            return max;\n        }\n        int winner = arr[0]; int cnt = 0;\n        for(int i=1; i<n; i++){\n            if(arr[i]<winner){\n                cnt++;\n                if(cnt == k)return winner;\n            }\n            else{\n                winner = arr[i];\n                cnt=1;\n                if(cnt==k)return winner;\n            }\n        }\n        return winner;\n    }\n}
['Simulation', 'Java']