book(calendar, start, end) where calendar is a list of existing (start, end) bookings (end exclusive): append and return True only when the new slot overlaps nothing; otherwise False. Two slots conflict when each starts before the other ends.book([(9, 10), (11, 12)], 10, 11)
True
The 10-11 gap is exactly free (end-exclusive).
book([(9, 10), (11, 12)], 9, 12)
False
It would swallow both existing meetings.
Conflict test: s < existing_end and existing_start < e.
any() over the calendar.