The merge keeps the larger end
transcript
Merge three events. One to ten, two to four, five to seven. What is the answer?
The first event runs from one to ten. The second sits inside it, from two to four. The third starts at five, still inside ten.
A wrong version sets the end to the new event's end. Two to four drops the end from ten to four. Now five to seven looks separate.
Take the larger of the two ends. Two to four ends inside the block. The end stays ten. Five to seven joins. One block, one to ten.
Run the three events through both versions. The last end gives two blocks. The larger end gives one.
Join when the start is at most the block's end. Then set the end to the larger of the two ends. Do it for every join, with no exceptions.
A long event can contain many short ones. The short ones end early. They must not lower the end.
Which ends count decides the answer. Full breakdown in the lecture.