Problem 675 · Hard
Cut trees in height order, walking a shortest path between consecutive trees with BFS.
Open the interactive visualisation