Java | 2 lines | Simple | Clean code
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n  public int rangeSumBST(TreeNode node, int low, int high) {\n    if (node == null) return 0;\n    \n    return (node.val >= low && node.val <= high ? node.val : 0) +\n      (low < node.val ? rangeSumBST(node.left, low, high) : 0) +\n      (high > node.val ? rangeSumBST(node.right, low, high) : 0);\n  }\n}\n\n```\nIf you like my solution, please upvote it!
['Depth-First Search', 'Binary Search Tree', 'Java']