int i = 0,j = 0,a = 0;

int minDepth(struct TreeNode* root) {

if(!root) return 0;

i++;

printf("%d\n",i);

if(root->left == NULL && root->right == NULL){

j++;

if(j == 1) a = i;

if(i < a) a = i;

j=1;

}

minDepth(root->left);

minDepth(root->right);

return a;

}