PostOrder | DFS | Python
\nclass Solution(object):\n    def averageOfSubtree(self, root):\n        self.count = 0\n        def dfs(root):\n            if root is None: return 0, 0 \n   
```\nclass Solution(object):\n    def averageOfSubtree(self, root):\n        self.count = 0\n        def dfs(root):\n            if root is None: return 0, 0 \n            \n            leftSum, leftCount = dfs(root.left)\n            rightSum, rightCount = dfs(root.right)\n            \n            current_sum = root.val + leftSum + rightSum\n            current_count = 1 + leftCount + rightCount\n            \n            if root.val == current_sum/current_count:\n                self.count += 1\n            return current_sum, current_count\n        dfs(root)\n        return self.count\n            \n```
['Depth-First Search', 'Python']