Problem 979 · Medium

Distribute Coins in Binary Tree

Each edge carries the surplus of coins below it; the moves are the total of those surpluses.

Open the interactive visualisation