BST keys in range

wrong answer on test 1. I have tred this question by assuming the array given iss the preorder traversal. when I got WA then I sorted the array to form a balanced BST then searched the range

dont just sort the array just make that the tree using preorder traversel which is given and inorder traversel by making the array sorted

Not getting! Can you please elaborate

just take the input and make BST dont sort the array
like
cin>>x
insertintoBST(X)