Pregunta de entrevista de Google Cloud

LC dynamic programming medium difficulty