Here initially when we fill diagonals it is assumed that evrything else is finished and that particular is only left.Why so?
When we are filling diagonals why is it assumed that only those are left and others finished?
left part is ignored because
si can’t be less than ei
left part shows si <ei
si-> starting index
ei-> ending index
No i didnt mean that i meant that when we r filling the diagonal values why is it assumed that only that value exists and other are sold?
because at diagonal
si==ei ==> which means you have only one bottle left
for ex
if si=2 and ei=4
then it means you have 3 bottles left
if si=4 and ei=4 then it means you have only one bottle left
if one bottle left means rest are sold
this is bottom up dp
first we consider smallest case and then build bigger problem using this smaller problem
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.