Python3 | Easy to understand | InOrder Traversal
\n# Definition for a binary tree node.\n# class TreeNode:\n#     def __init__(self, x):\n#         self.val = x\n#         self.left = None\n#         self.righ
```\n# Definition for a binary tree node.\n# class TreeNode:\n#     def __init__(self, x):\n#         self.val = x\n#         self.left = None\n#         self.right = None\n\nclass Solution:\n    def rangeSumBST(self, root, L, R):\n        """\n        :type root: TreeNode\n        :type L: int\n        :type R: int\n        :rtype: int\n        """\n        return self.inorder(root, 0, L, R)\n            \n    def inorder(self, root, value, L, R):\n        if root:\n            value = self.inorder(root.left, value, L, R)\n            if root.val >= L and root.val <= R:\n                value += root.val\n            value = self.inorder(root.right, value, L, R)\n        \n        return value\n```\n\n**UPDATE**\nWe may optimize this by setting the \n```\nif root.val >= L and root.val <= R:\n``` \nas\n```\nif root.val > R:\n\treturn value\nelif root.val >= L:\n\tvalue += root.val\n```
[]