As shown in @Anonymouse, you can use 96 bits, i.e. 12 bytes to represent the day, so a 30-minute meeting starting at 1:00 in the morning will be represented as 110,000, and you can use simple | for all rooms.
Time O (n) Memory O (12n) bytes. That would be more theoretical.
Assembly meeting [start time per minute, end time per minute].
Combining two meetings (Sa and Sb) in Sc when overlapping
Sc [minimum (SA-start, SB-start), maximum (end SA, SB-end)] and save the combined collections in the collection. If they do not overlap, you can save them separately.
We know that total minutes per day = 24 * 60 = 1440 If you have a 15-minute block, it becomes 24 * 60/15 = 96 (less than 1 byte)
So, you need 2 bytes per schedule, that is, the beginning, the end of the byte.
Time O (n) Memory O (2n) bytes
Both approaches will not work if you have to delete the appointment later. To do this, you should definitely post all the original meeting schedules separately.
d1val source share