Given the root of a binary tree, return true if the tree is its own mirror image and false otherwise.
Picture a vertical line through the root. The tree is a mirror image of itself when folding it along that line lays every node on the left exactly onto a node on the right with the same value, and leaves no node on either side without a partner. Shape matters as well as values: a left child on one side must face a right child on the other.
The outer pair of grandchildren are both -3 and the inner pair are both 6.
Both 9s have their 6 as a left child. The two sides are copies of each other, not reflections: the reflection of the left side would have its 6 on the right.
The left -2 has only a right child and the right -2 has only a left child, so the two 1s face each other across the middle.
Constraints
1 and 1000 nodes.-100 <= Node.val <= 100Compare the left subtree with the right one as reflections: two nodes match when their values are equal, the first's left child matches the second's right child, and the first's right child matches the second's left.
true