// Invert a binary tree.

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

// Input: [4, 2, 7, 1, 3, 6, 9]

// Output: [4, 7, 2, 9, 6, 3, 1]


var invertTree = function(root) {
    if(!root || root.left === null && root.right === null){
        return root;
    }
    var temp = root.left;
    root.left = root.right;
    root.right = temp;
    invertTree(root.left);
    invertTree(root.right);
    return root;
};

@@ -222,16 +222,281 @@
 3, 1%5D%0A%0A%0A
+// if root is null%0A// or the root has no children return root%0A// create a temp variable and set it to root.left to store for now%0A// set root.left to root.right%0A// set root.right to the temp variable we stored%0A// invertTree on each child of the root%0A// return root%0A%0A
 var inve

add logic