Verify if a given binary tree is a BST. Duplicate values appear towards the left.
Asked in the phone interview stage. This was the first question.
Implement def is_bst(root):. Each node is a dictionary with keys val, left, and right, or null. Return true if every left-subtree value is less than or equal to its ancestor and every right-subtree value is strictly greater; otherwise return false.
def is_bst(root):