Hint to solve the problem

Please someone provide hint to solve the given problem.

Hi @mohitkanodia713,
use recursion to solve this question,go to every character of the input string and make an empty string ans if you find pi then put ans=ans+‘3.14’ else you simply add that character.

Thanks, I got the correct solution.