Pregunta de entrevista de Revolut

There was a dynamic programming question