Pergunta de entrevista da empresa BlackRock

Java question on Dynamic Programming.