Farmer frenzy doubt

can we do it problem using dp instead of Largest Area in a Histogram method. if yes plz tell how?

@saiKDr,
I think this is what you are looking for, but I would still recommend to go with the stack method, it may seem complicated now, but will be very convenient ones understood. This stack method has various applications in many problems. Its good to understand it well.

@abhijeet.srivastava6499 thank you

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.