Algorithm · Pinterest · Medium
A restaurant is open every day from a given open time to a close time and has a fixed number of seats (capacity). You have a list of existing reservations, sorted by their start times. Each reservation is a triplet [ , , ] that tells you the reserved time window and how many seats are taken. Return every contiguous time block within the operating hours along with the number of available seats at that time, in chronological order. The answer must be a list of triples…
Checking your access…