Problem 675 · Hard

Cut Off Trees for Golf Event

Cut trees in height order, walking a shortest path between consecutive trees with BFS.

Open the interactive visualisation