NeetCode #466LC-538MediumTrees
← Back to All Problems#466 · #538 · Convert BST to Greater Tree(把二叉搜索树转换为累加树)
📌 Problem Statement & Constraints
Given the root of a binary search tree, convert it to a greater sum tree: every node's new value is the sum of all values greater than or equal to the original value. Return the root. Constraints: the number of nodes is in
[0, 10^4], -10^4 <= Node.val <= 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!