arrow_back Back to Challenges

#226 Invert Binary Tree

Easy Acceptance 0%
description

Problem Description

Given the `root` of a binary tree, invert the tree, and return its root.

checklist Constraints

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

science Examples

Case #1

In: root = [4,2,7,1,3,6,9]
Out: [4,7,2,9,6,3,1]

Case #2

In: root = [2,1,3]
Out: [2,3,1]

Mastery Tags

Recursion Trees

Hiring Companies

Amazon Google Meta
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude