You are viewing a single comment's thread. Return to all comments →
Refer to this http://www.geeksforgeeks.org/largest-rectangle-under-histogram/. It will work in all the testcases. When the stack is empty, it is considering length as i(current_index) and finding the area.
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 →
Refer to this http://www.geeksforgeeks.org/largest-rectangle-under-histogram/. It will work in all the testcases. When the stack is empty, it is considering length as i(current_index) and finding the area.