Next Greater Element II  || C++ || Easy Solution
class Solution\n{\npublic:\n    vector nextGreaterElements(vector &nums)\n    {\n        int n = nums.size();\n        stack st;\n        vector v(n);\n        
class Solution\n{\npublic:\n    vector<int> nextGreaterElements(vector<int> &nums)\n    {\n        int n = nums.size();\n        stack<int> st;\n        vector<int> v(n);\n        for (int i = 2 * n - 1; i >= 0; i--)\n        {\n\n            while (!st.empty() && st.top() <= nums[i % n])\n            {\n                st.pop();\n            }\n            if (st.empty())\n                v[i % n] = -1;\n            else\n                v[i % n] = st.top();\n            st.push(nums[i % n]);\n        }\n\n        return v;\n    }\n};
['Stack', 'C', 'Monotonic Stack', 'C++']