```
var constructMaximumBinaryTree = function(nums) {
let insert = function (tree, node) {
if (tree && tree.val > node.val) {
let temp = insert(tree.right, node)
tree.right = temp
return tree
} else {
node.left = tree
return node
}
}
let res = null
for (let num of nums) {
let node = new TreeNode(num)
res = insert(res, node)
}
return res
}
```