Dynamic programming quiz

how is anser b of question number 6??