findtilt-single-pass-postorder

Status: IN

`findTilt` computes total tilt in a single O(n) postorder traversal by having `subtree_sum` return the value sum upward while accumulating tilt into a `nonlocal` closure variable as a side effect.

Source: entries/2026/06/06/binary-tree-tilt-solution.md

JSON