AlgoDaily Solution
1Locked, only available for premium members.Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx69
var assert = require('assert');function TreeNode(val) { this.val = val this.left = null this.right = null}/** * @param {TreeNode} root * @param {number} low * @param {number} high * @return {number} */function sumRangeBST(root, low, high) { return}try { let root = new TreeNode(10) root.left = new TreeNode(5) root.right = new TreeNode(15) root.left.left = new TreeNode(3) root.left.right = new TreeNode(7) root.right.right = new TreeNode(18) assert.equal(sumRangeBST(root, 7, 15), 32);OUTPUT
Results will appear here.