199. Binary Tree Right Side View
·
Algorithm
Binary Tree Right Side View - 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. Queue를 이용한 풀이 class Solution: def rightSideView(self, root: TreeNode) -> List[int]: if not root: return [] answer, trace = [], defaultdict(int) q = deque([(root, 0)]) while q: cur_node, cur_level = q.p..