C solution
\nint rangeSumBST(struct TreeNode* root, int L, int R){\n    if (!root) {\n        return 0;\n    }\n    if(root->val<L){\n        return rangeSumBST(root->righ
```\nint rangeSumBST(struct TreeNode* root, int L, int R){\n    if (!root) {\n        return 0;\n    }\n    if(root->val<L){\n        return rangeSumBST(root->right, L, R);\n    }\n    if(root->val>R){\n        return rangeSumBST(root->left, L, R);\n    }\n    return root->val + rangeSumBST(root->left, L, R) + rangeSumBST(root->right, L, R);\n}\n```
[]