https://onlinegdb.com/R_7Py1s7H

why there is no output displaying on screen?

Hello @hittasehgal,

Inside the replace_pi function, modify your

replace_pi(a+1, n);
to
replace_pi(a+1, n-1);

Here we need to decrease n by 1 because a is updated to a+1 and length decreases by 1.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.