Pregunta de entrevista de Meta

Went through two technical problems, one involving dynamic programming.