gary@interview:~/interview/coding/590-n-ary-tree-p….md$
$ cat ./coding/590-n-ary-tree-postorder-traversal.md
[Coding]

590. N-ary Tree Postorder Traversal

────────────────────────────────────────────────────────────

590. N-ary Tree Postorder Traversal

"""
# Definition for a Node.
class Node:
    def __init__(self, val=None, children=None):
        self.val = val
        self.children = children
"""

class Solution:
    def postorder(self, root: 'Node') -> List[int]:
        if not root:
            return []
        res = []
        for child in root.children:
            res.extend(self.postorder(child))
        res.append(root.val)
        return res

--tags#Tree#Postorder Traversal
$ ls ./coding/ | grep -v 590-n-ary-tree-postorder-traversal
265. Paint House II256. Paint House143. Reorder List1762. Buildings With an Ocean View
← cd ../codingcd ~