Largest rectangle in histogram

i have coded the question best to my ability, could you please help me rectify my code ?

let me know where i can share the code …

Hey @harshitakhemani share your code using ide.codimgblocks.com with problem link also.

If you don’t know how to share code using ide.codingblocks.com , you can also ask me that.

here , can u please take a look at the code


– question link

The logic you have used, you weren’t able to implement it properly. This logic is complicated as well as slow for processing time too. Run your program for this input: [3,5,5,2,5,5,6,6,4,4,1,1,2,5,5,6,6,4,1,3]
Expected output is: 24
Yours is giving: 75
I would suggest you to watch this video: https://youtu.be/MhQPpAoZbMc
as it will clear all your doubt.
Whereas code for same is here

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.