Cut the tail, then join.
transcript
Your partition runs for ever. Every node is in place. One pointer was left behind. It points into the past. Nothing crashes. It loops for ever. Check the last node.
Limit five. Two chains grow at their tails. Light is one, three, two. Heavy is five, eight. Now they must be joined. Two chains, built in order.
Eight was the last heavy node. Its next is still three. Three is on the light chain. That is a loop. A pointer from the old belt.
Set the next of eight to null. Then join two to five. The chain has an end. One, three, two, five, eight. One extra line.
First, cut the heavy tail. Second, join light to heavy. Never the other way. Test with a light last node. Skip it, and the list loops.
Cut, then join. Check the last node. Try the sandbox. Cut first, always. Full breakdown in the lecture.