Booking.com interview question

Two programming problems, probably around easy-medium on hackerrank. O notation and reasoning for the solutions you give.