A binary tree is symmetric if it is a mirror image of itself around its centre: the left side is the reverse of the right side, in both shape and values.
Given the tree root, return true if it is symmetric, and false if it is not.
How the judge passes the data
Examples
Example 1:
Input: root = [5,3,3,1,2,2,1]
Output: true
Explanation: The left side (3 with children 1 and 2) mirrors the right side (3 with children 2 and 1).
Example 2:
Input: root = [4,2,2,6,null,6,null]
Output: false
Explanation: Both sides have a left child 6. In a mirror, the right side would need a right child.
Example 3:
Input: root = [7,1,1,null,5,5]
Output: true
Explanation: The left 1 has a right child 5. The right 1 has a left child 5. They mirror each other.