Java recursion
\nclass Solution {\n    public int rangeSumBST(TreeNode root, int L, int R) {\n        if (root == null) {\n            return 0;\n        }\n        if (root.v
```\nclass Solution {\n    public int rangeSumBST(TreeNode root, int L, int R) {\n        if (root == null) {\n            return 0;\n        }\n        if (root.val >= L && root.val <= R) {\n            return root.val + rangeSumBST(root.left, L, R) + rangeSumBST(root.right, L, R);\n        } else if (root.val < L) {\n            return rangeSumBST(root.right, L, R);\n        } else {\n            return rangeSumBST(root.left, L, R);\n        }\n    }\n}\n```
[]