terminal
Elevo
/
ESC
Login
Initiate Registration
code
Topics
corporate_fare
Companies
history
History
arrow_back
Back to Challenges
#226
Invert Binary Tree
Easy
Acceptance 0%
Editorial
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
Python 3
expand_more
C
C++ 17
Java
JavaScript
Python 3
C
C++ 17
Java
JavaScript
Python 3
refresh
class Solution: def invertTree(self, root: TreeNode) -> TreeNode: pass
Login to Compile
Processing
terminal
Debug Output
home
Home
extension
Practice
robot_2
login
Sign In
account_circle
Menu
code_blocks
Coding
psychology
Aptitude
Navigation
close
Login
Registration