def min_depth(self, root):
    '\n    :type root: TreeNode\n    :rtype: int\n    '
    if (root is None):
        return 0
    if ((root.left is not None) or (root.right is not None)):
        return (max(self.minDepth(root.left), self.minDepth(root.right)) + 1)
    return (min(self.minDepth(root.left), self.minDepth(root.right)) + 1)
:type root: TreeNode
:rtype: int
def min_depth(self, root):
    '\n    :type root: TreeNode\n    :rtype: int\n    '
    if (root is None):
        return 0
    if ((root.left is not None) or (root.right is not None)):
        return (max(self.minDepth(root.left), self.minDepth(root.right)) + 1)
    return (min(self.minDepth(root.left), self.minDepth(root.right)) + 1)