This is my Python solution to the minimum depth of binary tree problem. The solution takes slightly more than 250ms and apparently is not the best solution. I wonder how it can be faster:

```
# Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return an integer
def minDepth(self, root):
if root is None:
return 0
elif root.left is None and root.right is None:
return 1
elif root.left is None:
return self.minDepth(root.right)+1
elif root.right is None:
return self.minDepth(root.left)+1
else:
return min(self.minDepth(root.left),self.minDepth(root.right))+1
```