Pergunta de entrevista da empresa Booking.com

Coding challenge with two easy two hard wuestions