def reConstructBinaryTree(self, pre, tin):
# write code here
if len(pre)==0 or len(tin)==0:return None
root=pre[0]
flag=tin.index(pre[0])
n=TreeNode(root)
n.left=self.reConstructBinaryTree(pre[1:1+flag],tin[:flag])
n.right=self.reConstructBinaryTree(pre[flag+1:],tin[flag+1:])
return n