python use visualization help you think about it.
L = 7, R = 15, sum=32:\n\n         *10\n         /  \\\n       *5    *15\n       / \\     \\\n      3   *7    18\n\n\t  \n2.  L = 6, R = 10, sum=23 :\n\n\t     
1. L = 7, R = 15, sum=32:\n```\n         *10\n         /  \\\n       *5    *15\n       / \\     \\\n      3   *7    18\n```\n\t  \n2.  L = 6, R = 10, sum=23 :\n```\n\t            *10\n               /    \\\n              5      15\n             / \\     / \\\n            3   *7  13  18\n           /   /\n         1    *6\n\n```\n```\nclass Solution(object):\n    def rangeSumBST(self, root, L, R):\n        def dfs(node):\n            if node:\n                if L<= node.val <= R:\n                    self.ans += node.val\n                    #print(node.val)\n                if node.val>L:\n                    dfs(node.left)\n                if node.val<R:\n                    dfs(node.right)\n        self.ans = 0\n        dfs(root)\n        return self.ans\n\n
['Depth-First Search', 'Python']