Trees • Easy

Invert Binary Tree

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

The Challenge

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

Difficulty Easy
Topic Trees

Pro-tip: Use recursion. Swap the left and right children for each node.

Solution.swift Tests.swift
Output
Ready to run.