Mixtures problem

please explain me the concept by providing a dry run for the second test case in the video

arr[] -> 40, 60, 20.

  1. first option is to break at i=0.
    so subproblems are (40) and (60, 20) so here if you will furthur break (60, 20)
    then (60) and (20) since for i>=j return 0, so they return 0
    now for (60, 20) the answer is 60*20 = 1200
    which will be returned to (40, 60, 20) here we know the answer for (40) and (60, 20) subproblems
    so here answer will be = answer_for(40) + answer_for(60, 20) + 40 * (60+20)
    = 0 + 1200 + 3200 = 4400

  2. similarly if break i=1 => (40, 60) and (20)
    so here = answer_for(40, 60) + answer_for(20) + (60+40)%100 * (20).
    = 2400 + 0 + 0 = 2400

@aslesha.j7 i hope this clears your doubt

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.