Flip Equivalent Binary Trees
LeetCode 951 • Medium • Trees • Anduril
Two trees are flip-equivalent if you can flip any nodes so they match. Recurse: no-flip or flip children.
TimeO(n)
SpaceO(h)
Root
A children
B flipped
step—
note—
Ready
Press Play to walk the algorithm.