//Definition for a binary tree node.
func isSymmetric(root *TreeNode) bool {
return _isSymmetric(root, root)
func _isSymmetric(left, right *TreeNode) bool {
if left == nil && right == nil {
if left != nil || right != nil {
return _isSymmetric(left.Left, right.Right) && _isSymmetric(right.Left, left.Right) && left.Val == right.Val