Pergunta de entrevista da empresa Microsoft

Simple 1D Dynamic Programming Question