Booking.com Interview Question

Sliding window and greedy algorithm