✅100%🔥Easy Java Solution🔥With explanation🔥
Code\n\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        int count = 0;\n        for(int i = 1; i < arr.length; i++) {\n            if(ar
# Code\n```\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        int count = 0;\n        for(int i = 1; i < arr.length; i++) {\n            if(arr[i] > arr[0]) {\n                count = 0;\n                swap(arr, i, 0);\n            }\n            count++;\n            if(count == k) {\n                return arr[0];\n            }\n        }\n        return arr[0];\n    }\n    public void swap(int[] arr, int i, int j) {\n        int temp = arr[i];\n        arr[i] = arr[j];\n        arr[j] = temp;\n    }\n}\n```
['Java']