solve minimum depth of binary tree