Solve the minimum depth of binary tree problem.