I want to know the DP approach for this

I did this question with the approach of using stack…u can say greedy one…I want to know the DP approach…what will be the recurrence relation…

@kaushikjatin
Check this out


Kindly close the doubt

1 Like

Bro I have done with the largest area rectangle under the histogram method …as discussed in this question…but I want to know the DP approach…like that one of largest square…

@kaushikjatin
Try this one then https://stackoverflow.com/questions/11481868/largest-rectangle-of-1s-in-2d-binary-matrix

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.