[Python3] post-order dfs
Please pull this commit for solutions of weekly 292. \n\n\nclass Solution:\n    def averageOfSubtree(self, root: Optional[TreeNode]) -> int:\n        \n        
Please pull this [commit](https://github.com/gaosanyong/leetcode/commit/9aa0edb0815f3e0a75a47808e1690ca424f169e5) for solutions of weekly 292. \n\n```\nclass Solution:\n    def averageOfSubtree(self, root: Optional[TreeNode]) -> int:\n        \n        def fn(node): \n            nonlocal ans\n            if not node: return 0, 0 \n            ls, ln = fn(node.left)\n            rs, rn = fn(node.right)\n            s = node.val + ls + rs\n            n = 1 + ln + rn\n            if s//n == node.val: ans += 1\n            return s, n\n        \n        ans = 0 \n        fn(root)\n        return ans \n```\n\nAdded iterative implementation \n```\nclass Solution:\n    def averageOfSubtree(self, root: Optional[TreeNode]) -> int:\n        ans = 0 \n        mp = {None: (0, 0)}\n        node, stack = root, []\n        prev = None\n        while node or stack: \n            if node: \n                stack.append(node)\n                node = node.left \n            else: \n                node = stack[-1]\n                if node.right and node.right != prev: node = node.right\n                else: \n                    stack.pop()\n                    ls, lc = mp[node.left]\n                    rs, rc = mp[node.right]\n                    sm, cnt = ls + node.val + rs, lc + 1 + rc\n                    mp[node] = (sm, cnt)\n                    if sm//cnt == node.val: ans += 1\n                    prev = node \n                    node = None\n        return ans \n```
['Python3']