💥 Python | Easy solution | Explanation 💥
First of all, we check if k is longer than the length of arr. If it is, it means that we need to check every element, so the largest element will fit.\n\n\nif k
First of all, we check if `k` is longer than the length of `arr`. If it is, it means that we need to check every element, so the largest element will fit.\n\n```\nif k > len(arr):\n\treturn max(arr)\n```\n\nIf `k` is smaller, we check the array. Every time that `arr[curr]` (current) is bigger than `arr[opp]` (opponent), we add a win. If not, we initialize `wins` to 1 and keep checking the array until `wins` equals `k`, and then stop.\n\n```\nclass Solution(object):\n    def getWinner(self, arr, k):\n        \n        n = len(arr)\n        if k > n:\n            return max(arr)\n\n        wins = 0\n        curr = 0\n        opp = 1\n        while (wins != k):\n            if arr[curr] > arr[opp % n]:\n                wins += 1\n            else:\n                wins = 1\n                curr = opp\n            opp += 1\n        return arr[curr]\n```\n
['Python']