C++ || Esay to Read || using stack
class Solution {\npublic:\n    \n\tint getWinner(vector& arr, int k) {\n        \n        int n = arr.size();\n        vector vis(n, 0);\n        stack> st;\n  
class Solution {\npublic:\n    \n\tint getWinner(vector<int>& arr, int k) {\n        \n        int n = arr.size();\n        vector<int> vis(n, 0);\n        stack<pair<int,int>> st;\n        \n        \n        for(int i=n-1; i>=0; i--){\n            \n            \n            int count = 1;\n            \n            if(i != n-1){\n                \n                while(!st.empty() and st.top().first < arr[i]){\n                    count += st.top().second;\n                    st.pop();\n                }\n            }\n            \n            st.push({arr[i], count});\n            \n            if(i != 0 and arr[i-1] < arr[i]){\n                count++;\n            }\n            \n            \n            count--;\n            \n            vis[i] = count;\n            \n        }\n        \n        int ans = 0;\n        \n        for(int i=0; i<n; i++){\n            \n            if(vis[i] >= k) return arr[i];\n            \n            else{\n                ans = max(arr[i], ans);\n            }\n            \n        }\n        \n        \n        return ans;\n    }\n};
['C', 'C++']