valid BST Python accepted