Pergunta de entrevista da empresa Infosys

A question based on dynamic programming