Pregunta de entrevista de BMW Group

A simple algorithm question which I don't remember