Leaf-Similar Trees
Check whether two trees have the same leaf values in the same left-to-right order. The visual collects each tree's leaves in sequence and compares the two lists.
Check whether two trees have the same leaf values in the same left-to-right order. The visual collects each tree's leaves in sequence and compares the two lists.