Search
⌘K

Leetcode 938. Range Sum of BST

Given the root of a binary search tree and an inclusive range [low, high], return the sum of all node values that fall within the range. Leverage the BST ordering to prune subtrees that are entirely < low or > high and traverse only the relevant nodes.

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid March, 2026

Meta

Staff

Given the root of the BST and high and low values, find the sum of nodes in this range.

Mid December, 2025

Meta

Senior

Early October, 2025

Meta

Mid-level

Your account is free and you can post anonymously if you choose.