Pergunta de entrevista da empresa Goldman Sachs

a question on dynamic programming and other on hashmap.