solution to Validate Binary Search Tree