Can you provide a solution with better algorithmic performance?
Anonymous
Yes - use an interval tree as your base data structure where assuming not all events overlap - the performance would be n log n.
Check out your Company Bowl for anonymous work chats.