Given two integer arrays preorder and inorder representing the preorder and inorder traversals of the same binary tree, reconstruct the binary tree and return its root. Assume all node values are unique, and the traversals are valid.
def build_tree(preorder, inorder):