Range Sum of Binary Search Tree

Given the root of a binary search tree and two integers low and high, return the sum of all node values in the inclusive range [low, high].

A BST has all left-subtree values less than the node ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: