Study Notes
Problem editorialmedium

Reaching zero by split and merge

Split a number into two that sum to it; merge two into their XOR. Do not hunt for the moves — find the property the moves cannot touch.

19 min read·time O(N)·space O(1)
Invariant huntingParity argumentSum vs XOR