Pregunta de entrevista de Bosch

Create an algorithm with a given complexity, based on a specific problem.