Invert Binary Tree (medium)

Problem Statement

Given the root of a binary tree, invert it.

Example:

Given the following two binary trees:

Image

Try it yourself

Try solving this question here:

NaN
NaN

LOADING....
. . .