Design Gurus Logo
Invert Binary Tree (medium)
Go Back

Problem Statement

Given the root of a binary tree, invert it.

Example:

Given the following two binary trees:

Image

Constraints:

  • The number of nodes in both trees is in the range [0, 100].
  • -100 <= Node.val <= 100

Try it yourself

Try solving this question here:

Python3
Python3