solve same_tree