145. Binary Tree Postorder Traversal
https://leetcode.com/problems/binary-tree-postorder-traversal
Python
class Solution:
def postorderTraversal(self, root: Optional[TreeNode]) -> List[int]:
return self.travel([], root)
def travel(self, result, node):
if not node:
return
self.travel(result, node.left)
self.travel(result, node.right)
result.append(node.val)
return result