Pregunta de entrevista de Miro

Algorithmic Problem with explanation of its complexity.