Pergunta de entrevista da empresa Microsoft

A dynamic programming question was asked