Symmetric Tree

Medium

Question

Given the root of a tree, return whether the tree is symmetric.

Symmetric Tree Example 1

Input: root = [1, 2, 2, 3, 4, 4, 3]

Output: True

Symmetric Tree Example 2

Input: root = [1, 2, 2, 3, 4, 4, 4]

Output: False

Symmetric Tree Example 3

Input: root = [1, 2, 2, 3, None, 3, None]

Output: False

Clarify the problem

What are some questions you'd ask an interviewer?

Understand the problem

Which of these trees are NOT symmetric?
[1]
[5, 3, 3, 7, None, None, 7]
[3, 3, 3, None, 3, 3, None]
[5, 5, 5, 5, None, 5, None]

Login or signup to save your code.

Notes