Simplest Python code (Dict)
\n```\nclass Solution:\n    def getWinner(self, arr: List[int], k: int) -> int:\n        win={}\n        m=max(arr)\n        while True:\n            if arr[0]>
\n```\nclass Solution:\n    def getWinner(self, arr: List[int], k: int) -> int:\n        win={}\n        m=max(arr)\n        while True:\n            if arr[0]>arr[1]:\n                winner=arr[0]\n                arr.append(arr.pop(1))\n            else:\n                winner=arr[1]\n                arr.append(arr.pop(0))\n            if winner in win:\n                win[winner]+=1\n            else:\n                win[winner]=1    \n            if win[winner]>=k or winner==m:\n                return winner\n            \n\n\n\n\n
[]