var invertTree = function(root) {
if(!root) return null
const rightroot = root.right
root.right = invertTree(root.left)
root.left = invertTree(rightroot)
return root
};
var invertTree = function(root) {
if(!root) return null
const rightroot = root.right
root.right = invertTree(root.left)
root.left = invertTree(rightroot)
return root
};