Thank you so much. This was the best and most straightforward explanation after trying others... straight up and visualized clearly plus coded cleanly as well thank you!!
I use, for each ith rectangle, width = offset index to next smaller element + offset index to prev smaller element - 1 area is then height of the ith rectangle multiply the corresponding width, and return the max area. A little lengthy though
Master Data Structures & Algorithms for FREE at AlgoMap.io/
Thank you so much. This was the best and most straightforward explanation after trying others... straight up and visualized clearly plus coded cleanly as well thank you!!
Thanks for this. The idea is , the moment we see dip, we process the top of stack item in backward direction.
can we solve this with 2 pointer approach like storing rain water problem? if we are going with brute force can we use brute force + sliding window?
Great explanation, after the explanation I coded the thing by myself, and I did the exactly same code
I use, for each ith rectangle, width = offset index to next smaller element + offset index to prev smaller element - 1
area is then height of the ith rectangle multiply the corresponding width, and return the max area.
A little lengthy though
thank you so sir this is the best explanation I can get
Very good, this is a very complex topic
What would I do without Greg's videos
Same as NeetCode except stack tuple index and heights are interchanged.
How to come up with solution like this😩
hello sir you teach us very nice,
but can you make videos for solve dialy question in leetcode
it would be really helpful
thank you
not more intuitive than brute force :(
First comment 🥇