Winner of Array Game✅✅✅✅✅|
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![light.jpg](https://assets.leetcode.com/users/images/9b652f87-df4a-4cd7-85a0-28ecc66cde8b_1699242220.6714666.jpeg)\n\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n        int maxElement = arr[0];\n        int consecutiveWins = 0;\n\n        for (int i = 1; i < arr.length; i++) {\n            int currentElement = arr[i];\n            if (currentElement > maxElement) {\n                maxElement = currentElement;\n                consecutiveWins = 1;\n            } else {\n                consecutiveWins++;\n            }\n\n            if (consecutiveWins >= k) {\n                return maxElement;\n            }\n        }\n\n        return maxElement;\n    }\n}\n\n\n```
['Java']