Solution to Validate Binary Search Tree