✅Using Anonymous as Recursive. Modern, Simple Solution✅
If you have question, pls, write below. I will answer.\n# Complexity\n- Time complexity: O(N)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:
If you have question, pls, write below. I will answer.\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunc rangeSumBST(root *TreeNode, low int, high int) int {\n\tsum := 0\n\tvar recur func(root *TreeNode)\n\n\trecur = func(root *TreeNode) {\n\t\tif root.Val >= low && root.Val <= high {\n\t\t\tsum += root.Val\n\t\t}\n\t\tif root.Left != nil {\n\t\t\trecur(root.Left)\n\t\t}\n\t\tif root.Right != nil {\n\t\t\trecur(root.Right)\n\t\t}\n\t}\n\trecur(root)\n\n\treturn sum\n}\n\n```
['Go']