C++ | Two Pointer Solution O(n) TC and O(1) SC
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```\nclass Solution {\npublic:\n    int getWinner(vector<int>& a, int k) {\n        int count=0;\n        int i=0;\n        int j=1;\n        int n = a.size();\n        while(j<n)\n        {\n            if(a[i]>a[j])\n            {\n                count++;\n                j++;\n            }\n            else\n            {\n                count=1;\n                i=j;j++;\n            }\n            if(count==k)\n            return a[i];\n        }\n        return a[i];\n    }\n};\n```
['C++']