class Solution:
def constructMaximumBinaryTree(self, nums: List[int]) -> TreeNode:
if len(nums) == 0:
return None
val = max(nums)
pos = nums.index(val)
t = TreeNode(val)
t.left = self.constructMaximumBinaryTree(nums[:pos])
t.right = self.constructMaximumBinaryTree(nums[pos+1:])
return t