Why does this code not pass all test cases?

https://ide.codingblocks.com/s/118186 heres the link to the code

@sans_sehgal hey sanskar their no need to call remove this line
if(digit==0)
{
recur(in, out, i+1, j);
}