Monotonic Stack + Priority queue Super easy Solution
Priority queue contains elements which have found their first greater element and are looking for second greater element and stack contains elements which have 
Priority queue contains elements which have found their first greater element and are looking for second greater element and stack contains elements which have not found their first greater element . \nOnly difference between this problem and standard next greater element problems is priority queue.\n```\nclass Solution {\npublic:\n    vector<int> secondGreaterElement(vector<int>& nums) {\n        int n=nums.size();\n        \n        stack<int>st;\n        vector<int>b(n,-1);\n        priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>pq;\n        \n        for(int i=0;i<n;i++)\n        {\n             while(!pq.empty()&&nums[i]>pq.top().first)\n            {\n                b[pq.top().second]=nums[i];\n                pq.pop();\n            }\n            \n            while(!st.empty()&&nums[i]>nums[st.top()])\n            {\n                pq.push({nums[st.top()],st.top()});\n                st.pop();\n            }\n            \n           \n            st.push(i);\n        }\n        \n        while(!st.empty())\n        {\n            b[st.top()]=-1;\n            st.pop();\n        }\n        \n        while(!pq.empty())\n        {\n            b[pq.top().second]=-1;\n            pq.pop();\n        }\n        \n        return b;\n    }\n};\n```
['Stack', 'C', 'Heap (Priority Queue)']