Invert Binary Tree

Understand and solve the interview question "Invert Binary Tree".

Description

In this lesson, your task is to invert a given a binary tree, T.

Let’s look at an example below:

class TreeNode(var value:Int=0, var left:TreeNode=null, var right:TreeNode=null) {
}
object Solution {
def invertTree(root: TreeNode): TreeNode = {
//write your code here
root
}
}
Invert binary tree
...