Pregunta de entrevista de Booking.com

To code a solution for a sorting problem.