```javaclassSolution {publicintgetWinner(int[] arr,int k) {int result = arr[0];int winCount =0;for (int i =1; i <arr.length; i++) {if (arr[i] > result) { result = arr[i]; winCount =1; } else { winCount++; }if (winCount == k) {return result; } } return result; }}/***if before k count, can't find the ansthen after that the winner is still the max in array, so after arr len, return max one in arrayT: O(n)S: O(1) */```