Pregunta de entrevista de Squarepoint Capital

Two leet code style questions involving dynamic programming.