Given an array of unique integers preorder, return true if it is the correct preorder traversal sequence of a binary search tree.
Example 1:
Input: preorder = [5,2,1,3,6]
Output: trueExample 2:
Input: preorder = [5,2,6,1,3]
Output: falseConstraints:
1 <= preorder.length <= 10⁴1 <= preorder[i] <= 10⁴preorder are unique.Follow up: Could you do it using only constant space complexity?