Simple Easy to Understand Java Code || Beats 100%
Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        int winner = 
# Complexity\n- Time complexity:\nO(n)\n- Space complexity:\nO(1)\n# Code\n```\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        int winner = arr[0];\n        int wins = 0;\n        \n        for (int i = 1; i < arr.length; i++) {\n            if (winner > arr[i])\n                wins++;\n            else {\n                wins = 1;\n                winner = arr[i];\n            }\n            \n            if (wins == k)\n                break;\n        }\n        \n        return winner;\n    }\n}\n```
['Java']