less than 1 minute read

Given the root to a binary tree root, return whether it is symmetric.

Constraints

  • n ≤ 100,000 where n is the number of nodes in root

https://binarysearch.com/problems/Symmetric-Binary-Tree

Examples

Example 1

Input

  • root =

Output

  • answer = True

Example 2

Input

  • root =

Output

  • answer = False

Example 3

Input

  • root =

Output

  • answer = False

Example 4

Input

  • root =

Output

  • answer = False

Solution

Leave a comment