Pergunta de entrevista da empresa Microsoft

A Dynamic programming codility question