Solution to Min depth of binary tree