Largest Rectangle in Histogram - Leetcode 84 - Stacks (Python)

  Рет қаралды 5,230

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер: 14
@GregHogg
@GregHogg 5 ай бұрын
Master Data Structures & Algorithms for FREE at AlgoMap.io/
@SaiyaraLBS
@SaiyaraLBS 3 ай бұрын
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!!
@vivek.tiwary
@vivek.tiwary 3 ай бұрын
Thanks for this. The idea is , the moment we see dip, we process the top of stack item in backward direction.
@anirudd01
@anirudd01 5 ай бұрын
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?
@Everafterbreak_
@Everafterbreak_ 3 ай бұрын
Great explanation, after the explanation I coded the thing by myself, and I did the exactly same code
@JoeTan-nq4fq
@JoeTan-nq4fq 3 ай бұрын
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
@saachigupta4545
@saachigupta4545 4 ай бұрын
thank you so sir this is the best explanation I can get
@andrewcenteno3462
@andrewcenteno3462 5 ай бұрын
Very good, this is a very complex topic
@franciscoerramuspe
@franciscoerramuspe 2 ай бұрын
What would I do without Greg's videos
@sonyolcu23
@sonyolcu23 15 күн бұрын
Same as NeetCode except stack tuple index and heights are interchanged.
@ILLITAMDEVISRIPRASAD
@ILLITAMDEVISRIPRASAD Ай бұрын
How to come up with solution like this😩
@NoTMaFiA24
@NoTMaFiA24 5 ай бұрын
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
@donkeykong5616
@donkeykong5616 21 күн бұрын
not more intuitive than brute force :(
@funnyday0
@funnyday0 5 ай бұрын
First comment 🥇
Merge Sorted Array - Leetcode 88 - Arrays & Strings (Python)
6:08
LARGEST RECTANGLE IN HISTOGRAM - Leetcode 84 - Python
17:20
NeetCode
Рет қаралды 262 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Daily Temperatures - Leetcode 739 - Stacks (Python)
12:35
Greg Hogg
Рет қаралды 9 М.
Coding Interview Problem: Largest Rectangle in a Histogram
16:18
Jackson Gabbard
Рет қаралды 309 М.
L12. Largest Rectangle in Histogram | Stack and Queue Playlist
31:42
take U forward
Рет қаралды 62 М.
Koko Eating Bananas - Leetcode 875 - Binary Search (Python)
13:34
Largest rectangle in Histogram | Leetcode #84
27:43
Techdose
Рет қаралды 112 М.
ZigZag Conversion - Leetcode 6 - Arrays & Strings (Python)
7:56
Learn Machine Learning Like a GENIUS and Not Waste Time
15:03
Infinite Codes
Рет қаралды 402 М.
The LeetCode Fallacy
6:08
NeetCode
Рет қаралды 603 М.
Largest Rectangle in Histogram | Part - 1 | Leetcode 84
30:00
take U forward
Рет қаралды 226 М.