leetcode2sumc 938. Range Sum of BST C Leetcode 938. BST C Leetco...
leetcode 2和c 938.-BST-C-Leetcode的范围总和给定二叉搜索树的根节点和两个整数low和high,返回值在包含范围[low, high]内的所有节点的值之和。示例1:输入:root = [10,5,15,3,7,null,18],低= 7,高= 15输出:32说明:节点7、10和15位于[7, 15]范围内。 7 + 10 + 15 = 32。示例2:输入:root = [10,5,15,3,7,13,18,1,null,6],低= 6,高= 10输出:23说明:节点6、7和10位于[6, 10]范围内。 6 + 7 + 10 = 23。
下载地址
用户评论