Range Sum of BST (LC #938) sums all node values in range [low, high]. Use DFS with BST pruning: if current value is less than low, only recurse right. If greater than high, only recurse left. Otherwise, add current value and recurse both directions. This runs in worst case but often much faster with pruning. Space is for recursion. Meta asks variants: find the average instead of sum, or find how many nodes fall in the range. The pruning logic stays the same.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/meta-interview-prep/trees/range-sum-of-bst
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████████████████████████████████████████████████████████████████████