Correct code. A trillion steps.
transcript
This report is correct. It also takes three hours. The deadline is one hour. Let us count why.
Find the longest session with at most two categories. From start two, extend until a third category appears. From start three, extend again. Same plays, read again. Eight plays? Instant. The team keeps it as the reference.
A real channel plays 14,400 tracks in thirty days. Many themed channels never leave two categories. So every start reads to the end of the log. That is about 104 million steps. For one channel.
Now run ten thousand channels. About one point zero four trillion steps a night. At a hundred million a second, nearly three hours.
Here is the catch. A shorter session inside a valid one is valid. So the first attempt rereads plays it already checked. Keep one window. Left only moves forward. Each play joins once and leaves once. About nine seconds.
Correct code is where you start. Then count the work. Then remove the rereads.
Full breakdown in the lecture.