Easy to understand java code.
Approach\n Describe your approach to solving the problem. \n    Detail explain written in component  in code.\n# Complexity\n- Time complexity:\n Add your time 
# Approach\n<!-- Describe your approach to solving the problem. -->\n    Detail explain written in component  in code.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(1)\n# Code\n```\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        if(k>=arr.length) //if k is larger then array length\n        {\n            Arrays.sort(arr); // sort array in ascending order.\n            return(arr[arr.length-1]); //return winner element.\n        }\n        int ans=arr[0], c=0 ;\n        /* \n            ans contains first element.\n            c is a counter. \n        */\n        for(int i=1 ;i<arr.length;i++) // loop terminates after i==arr.length.\n        {\n            if(arr[i]>ans) // to find largest element\n            {\n                ans= arr[i]; // update ans .\n                c=0;// back counter at  base value.\n            \n            }\n            c++; \n            if(c==k) break; //counter reach k \n        }\n        return(ans); //return winner element.\n    }\n}\n```
['Array', 'Simulation', 'Java']