Booking.com interview question

A simple Vanilla JS based implementation