I am getting 1 test case wrong can anyone help

Naman, I have edited your code, You need to use char array instead of string, and there was a little bit error in the printing function of code, now its running perfectly fine,