Java & cpp one liner soln (brute force) And Java clean soln using BST
Java:\n\nclass Solution {\n    public int rangeSumBST(TreeNode root, int low, int high) {\n        \n        return (root != null && root.val <= high && root.va
Java:\n```\nclass Solution {\n    public int rangeSumBST(TreeNode root, int low, int high) {\n        \n        return (root != null && root.val <= high && root.val >= low ? root.val : 0) + (root == null ? 0 : rangeSumBST(root.left, low, high) + rangeSumBST(root.right, low, high));\n    }\n}\n```\ncpp:\n```\nclass Solution {\npublic:\n    int rangeSumBST(TreeNode* root, int low, int high) {\n\n        return (root != NULL && root->val <= high && root->val >= low ? root->val : 0) + (root == NULL ? 0 : rangeSumBST(root->left, low, high) + rangeSumBST(root->right, low, high));\n    }\n};\n```\n\nJava (clean code):\n```\nclass Solution {\n    public int rangeSumBST(TreeNode root, int low, int high) {\n        \n        if (root == null) return 0;\n        \n        if (root.val >= low && root.val <= high) {\n            \n            return root.val + rangeSumBST(root.left, low, high) + rangeSumBST(root.right, low, high);\n        }\n        else if (root.val < low) {\n            \n            return rangeSumBST(root.right, low, high);\n        }\n        \n        else {\n            return rangeSumBST(root.left, low, high);\n        }\n    }\n}\n```
['Binary Search', 'Depth-First Search', 'Recursion', 'C', 'C++', 'Java']