solve symmetric tree