
938. Range Sum of BST
·
Algorithm
Range Sum of BST - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 이진 탐색 트리의 low, high 값을 주면 low 이상 high 이하의 모든 노드의 값을 더해서 반환하는 문제다. 1. DFS, 완전 탐색 class Solution: answer = 0 def rangeSumBST(self, root: TreeNode, low: int, high: int) -> int: def dfs(cur): if low