Very easy solution python, python3
Very easy soln\n\n# Code\n\nclass Solution:\n    def averageOfSubtree(self, root: TreeNode) -> int:\n        res=[0]\n        def dfs(node):\n            if not
# Very easy soln\n\n# Code\n```\nclass Solution:\n    def averageOfSubtree(self, root: TreeNode) -> int:\n        res=[0]\n        def dfs(node):\n            if not node: return 0,0\n            ls,lc=dfs(node.left)\n            rs,rc=dfs(node.right)\n            s=ls+rs+node.val\n            c=1+rc+lc\n            if s//c==node.val: res[0]+=1\n            return s,c\n        dfs(root)\n        return res[0]\n```
['Python', 'Python3']