Pergunta de entrevista da empresa Infosys

coding question on dynamic programming