Amazon Interview Question

Reconstruct a BST from preorder traversal