Replace all pi with 3.14 with recursion

I have solved this but giving runtime error

here is link to code https://ide.codingblocks.com/s/166340

Your code tries to access res.substring() with out of bounds indexes. Eg. When res is pi then if vidx is 2 , then second thing throws exception

Hi Kapil
Refer the above statement

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.