invert-tree-tuple-swap-prevents-clobber

Status: IN

The simultaneous assignment `root.left, root.right = invert_tree(root.right), invert_tree(root.left)` evaluates both recursive calls before either assignment executes, preventing the bug where overwriting `root.left` first would lose the original left subtree before the right-side recursion reads it.

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

JSON