def maxDepth(self, root):
if not root:
return max(self.maxDepth(root.left) + 1, self.maxDepth(root.right) + 1)
yeah, I got the same code. But the running time is 93ms. I'm quite curious about how can it be shortened to 50ms.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.