Can't find anything wrong in the code

can anyone help in finding bug this code ?
I am getting write output for custom input but not still not getting it correct .

Raghav, pls share your code by saving on ide… so that I could check it…