In the given test case more than one binary tree is possible.
So there will be different pre-order traversal for the same tree. So which one to take?
like [4,2,3,5,6] is also a bst from the given array.
and should the node in the range should be printed in non-decreasing order?