2 JavaScript solutions
You need to return sum of values in range of numbers between L and R. Not between nodes of L and R\n\nvar rangeSumBST = function(root, L, R, sum=0) {\n    if(!r
You need to return sum of values in range of numbers between L and R. Not between nodes of L and R\n```\nvar rangeSumBST = function(root, L, R, sum=0) {\n    if(!root) return sum;\n    if(root.val<=R && root.val>=L)\n        sum += root.val;\n    return sum + rangeSumBST(root.left, L, R) + rangeSumBST(root.right, L, R);\n};\n\nvar rangeSumBST = function(root, L, R, sum=0) {\n    let stack = [root];\n    while(stack.length){\n        let node = stack.pop();\n        sum+=node.val>=L &&node.val<=R ? node.val : 0;\n        if(node.left)\n            stack.push(node.left);\n        if(node.right)\n            stack.push(node.right);\n    }\n    return sum;\n};\n```
['Recursion', 'JavaScript']