Validate Binary Search Tree Leetcode Solution Python