Shortest Python Solution?


  • 0
    class Solution(object):
        def maxDepth(self, root):
            return root and 1 + max(map(self.maxDepth, (root.left, root.right))) or 0
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.