easy java solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/*class Solution {\n    public int getWinner(int[] arr, int k) {\n        int n=arr.length;\n        int j=0;\n        int l=0;\n        int max=Arrays.stream(arr).max().getAsInt();\n        \n        if(k>=n)\n        return max;\n        while(j<k||l<k)\n        {   \n            if(arr[0]>arr[1]){\n             l=0;\n            shift(arr,1);\n            j++;\n            }\n            else if(arr[0]<arr[1])\n            {\n                j=0;\n                shift(arr,0);\n                l++;\n            }\n            if(l==k||j==k)\n            break;\n        }\n        return arr[0];\n\n        \n    }\n    public int [] shift(int arr[],int ind)\n    {\n        int n=arr.length;\n        int temp;\n\n        for(int i=ind;i<n-1;i++)\n        {  temp=arr[i+1];\n        arr[i+1]=arr[i];\n        arr[i]=temp;\n          \n        }\n        return arr;\n    }*/\n\n/*\npublic class Solution {\n    public int getWinner(int[] A, int k) {\n        int cur = A[0];\n        int win = 0;\n        \n        for (int i = 1; i < A.length; ++i) {\n            if (A[i] > cur) {\n                cur = A[i];\n                win = 0;\n            }\n            if (++win == k) {\n                break;\n            }\n        }\n        \n        return cur;\n    }\n}*/\npublic class Solution {\n    public int getWinner(int[] arr, int k) {\n        int n=arr.length;\n        int max=Arrays.stream(arr).max().getAsInt();\n        int winner=arr[0];\n        int win=0;\n        if(k>=n)\n        return max;\n        for(int i=1;i<n;i++)\n        {\n            if(arr[i]>winner)\n            {\n                winner=arr[i];\n                win=1;\n            }\n            else\n            win++;\n            if(win==k||winner==max)\n            return winner;\n        }\n        return winner;\n    }\n}\n\n```
['Java']