Pergunta de entrevista da empresa Google

question based on dynamic programming