class Solution: def levelOrder(self, root: TreeNode) -> List[int]: res=[] def dfs(root): if not root: return None res.append(root.val) dfs(root.left) dfs(root.right) dfs(root) return res