Pregunta de entrevista de Accenture

Python coding question on dynamic programming