Booking.com Interview Question

ranking problem