update min depth of binary tree solution using iteration;