NeetCode #456LC-669MediumTrees
← Back to All Problems

#456 · #669 · Trim a Binary Search Tree(修剪二叉搜索树)

📌 Problem Statement & Constraints

Given the root of a binary search tree and bounds low and high, trim the tree so all its values lie in [low, high], preserving the relative structure. Return the new root. Constraints: the number of nodes is in [1, 10^4], 0 <= low <= high <= 10^4.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!