Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort the events by the start time and in case of tie by the end time in ascending order.
Loop over the sorted events. Attend as much as you can and keep the last day occupied. When you try to attend new event keep in mind the first day you can attend a new event in.