Solving Invert Binary Tree in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Invert a binary tree.

Example:

Input:

     4
   /   \
  2     7
 / \   / \
1   3 6   9

Output:

     4
   /   \
  7     2
 / \   / \
9   6 3   1

Trivia:

This problem was inspired by this original tweet by Max Howell:

See the full details of the problem Invert Binary Tree at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go