Pregunta de entrevista de Google

A DSA question based on Dynamic Programming.