Sponsored
Use these hints if you're stuck. Try solving on your own first.
Store the events as a sorted list of intervals. If none of the events conflict, then the new event can be added.
Solve with full IDE support and test cases