Exercises/#32 Invert Binary Tree
#32

Invert Binary Tree

Easy🌳 Trees
40 XP

Problem

Given the root of a binary tree, invert the tree (mirror it) and return its root.

Examples

Input: [4,2,7,1,3,6,9]
Output: [4,7,2,9,6,3,1]
treedfsbfs
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

32 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features