🔥💥Simple  C++ Solution Using For Loop 💥🔥
\n# Approach\n Describe your approach to solving the problem. \n1. Initialize winner to be the first element of the input array arr. This represents the current
\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Initialize `winner` to be the first element of the input array arr. This represents the current winner.\n2. Initialize `cnt` to 0, which keeps track of the consecutive wins for the current winner.\n3. Iterate through the elements of the array starting from the second element (index 1).\n4. For each element in the array, compare it with the current winner. 5. If the current element is smaller, increment cnt because the current winner has won again.\n6. If the current element is greater, update the winner to be the current element and reset cnt to 1, as the new element has become the winner.\n7. Check if cnt has reached the value of k. If it has, return the winner as the answer, as they have won k consecutive times.\n8. If the loop completes without finding the winner, return the last assigned value of winner, as it will be the winner.\n# Complexity\n- Time complexity:$$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int getWinner(vector<int>& arr, int k) {\n             int winner = arr[0];\n     int cnt = 0;   \n     for(int i=1;i<arr.size();i++){\n        if(winner>arr[i]){\n            cnt++;\n        }\n        else{\n            cnt = 1;\n            winner = arr[i];\n        }\n        if(cnt==k) return winner;\n     }\n     return winner;\n    }\n};\n```
['Array', 'C++']