Pregunta de entrevista de BBD

ten code challenge to solve in two hours.