Pregunta de entrevista de BlackRock

Java question on Dynamic Programming.