Meta's News Feed infrastructure frequently works with ordered numeric attributes such as timestamps or priority scores. Given the root of a binary search tree and two bounds, return the sum of all node values in the inclusive range [low, high].
Use the BST ordering property to avoid exploring subtrees that cannot contain valid values.
Implement range_sum_bst(root, low, high), where root is a binary tree node, and low and high are integers. Each node has an integer val and optional left and right children. The evaluator constructs the tree from the provided level-order representation, using null for missing children. Return an integer.
The tree may be empty. All node values are unique, and low <= high.
def range_sum_bst(root, low, high):