Search⌘ K
AI Features

Solution: Symmetric Tree

Solution: Symmetric Tree asks whether a given binary tree is its own mirror around the root, with equal values and matching reflected child structure. Return whether it is symmetric.

Statement

Given the root of a binary tree, check whether it is a symmetric tree. A symmetric tree refers to a tree that is the mirror of itself, i.e., symmetric around its root.

Constraints:

  • The tree contains nodes in the range [1,500][1, 500]
...