Shortest Code || Rat bhi skte ho
daalo -1 stack mein, aur 0 ko nums ke back mein\n2.  jaldi se krlo pura yaad, interviewer ke saamne krdena anuvaad\n3.  upvote kroge to milegi jrur, ldki nhi jo
1. **daalo -1 stack mein, aur 0 ko nums ke back mein**\n2.  **jaldi se krlo pura yaad, interviewer ke saamne krdena anuvaad**\n3.  **upvote kroge to milegi jrur, ldki nhi job huzur**\n\n\n\n\n```\n int largestRectangleArea(vector<int>& nums) {\n    stack<int> st;\n    st.push(-1);\n    nums.push_back(0);\n    int ans=0,n=nums.size();\n    for(int i=0;i<n;i++)\n    {\n        while(!st.empty() && st.top()!=-1 && nums[i]<nums[st.top()]){\n                int h=nums[st.top()],st.pop();\n                ans=max(ans,h*(i-st.top()-1));\n        }\n        st.push(i);\n    }\n    return ans;\n    }\n\n```
[]