Problem 114 · Medium

Flatten Binary Tree to Linked List

Morris-style: at each node, find the rightmost node of the left subtree and attach the right subtree there.

Open the interactive visualisation