Easy · Trees
Is symmetric
Given the root of a binary tree, return true if the tree is a mirror image of itself around its center (its left subtree mirrors its right subtree in shape and values) and false otherwise. An empty tree is symmetric.
Examples
Example 1
[1,2,2,3,4,4,3] symmetricOutput: symmetric
Example 2
[1,2,2,·,3,·,3] not symmetricOutput: not symmetric
Rebuild it in the studio
Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.