这个有意思了:
class Solution: def nodeNum(self , head ): # write code here if head: return self.nodeNum(head.left) + self.nodeNum(head.right) + 1//简单易理解 else: return 0
这个有意思了:
class Solution: def nodeNum(self , head ): # write code here if head: return self.nodeNum(head.left) + self.nodeNum(head.right) + 1//简单易理解 else: return 0