BST Validation
Carry lower and upper bounds to every subtree.
Left subtree updates the upper bound.
Right subtree updates the lower bound.
Time complexity: O(n).
Space complexity: O(h) due to recursion.
The duplicate policy must be explicitly defined.