Symmetric Tree
Problem statement
Return true when the binary tree is a mirror of itself around its center, and false otherwise.
Function
isSymmetric(root: TreeNode) → booleanExamples
Example 1
root = [1,2,2,3,4,4,3]return = trueThe left and right subtrees mirror each other.
Constraints
- The tree contains at most
10^5nodes.