def build_node(lo, hi):
    node = TreeNode(preorder[self.index])
    self.index += 1
    j = inorder.index(node.val, lo, hi)
    if ((self.index < len(preorder)) and (preorder[self.index] in inorder[lo:j])):
        node.left = build_node(lo, j)
    if ((self.index < len(preorder)) and (preorder[self.index] in inorder[(j + 1):hi])):
        node.right = build_node((j + 1), hi)
    return node
def build_node(lo, hi):
    node = TreeNode(preorder[self.index])
    self.index += 1
    j = inorder.index(node.val, lo, hi)
    if ((self.index < len(preorder)) and (preorder[self.index] in inorder[lo:j])):
        node.left = build_node(lo, j)
    if ((self.index < len(preorder)) and (preorder[self.index] in inorder[(j + 1):hi])):
        node.right = build_node((j + 1), hi)
    return node