class Solution:
    def constructMaximumBinaryTree(self, nums):
        """
        :type nums: List[int]
        :rtype: TreeNode
        >>> Solution().constructMaximumBinaryTree([3,2,1,6,0,5])
        [6,3,5,null,2,0,null,null,1]
        """
        if not nums:
            return None
        else:
            max_num = max(nums)
            i = nums.index(max_num)
            root = TreeNode(max_num)
            root.left = self.constructMaximumBinaryTree( nums[:i])
            root.right = self.constructMaximumBinaryTree( nums[i+1:])    
            return root

class TreeNode:
    def __init__(self, label):
        self.label = label
        self.left = None
        self.right = None
                