Domanda di colloquio di SAP

I had some questions about dynamic programming and their time/space complexity