
337. House Robber III
·
Algorithm
House Robber III - 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 1. BFS를 이용한 Level 별 탐색(실패) from collections import defaultdict, deque class Solution: def rob(self, root: TreeNode) -> int: dict1 = defaultdict(int) if not root: return 0 q = deque([(root, 0)]) while q: cur_node, cu..