We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Thank you for this. The image you attached for us was a big enough clue to solve this problem.
I didn't use stack. I just used a loop with two nested loops. The key here is to check both left and right direction for checking the height of buildings.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Largest Rectangle
You are viewing a single comment's thread. Return to all comments →
Thank you for this. The image you attached for us was a big enough clue to solve this problem.
I didn't use stack. I just used a loop with two nested loops. The key here is to check both left and right direction for checking the height of buildings.