"""# Definition for a Node.class Node: def __init__(self, val=None, children=None): self.val = val self.children = children"""classSolution:defpostorder(self,root:'Node') -> List[int]:ifnot root:return [] res = []for child in root.children: res.extend(self.postorder(child)) res.append(root.val)return res