You are given a string s. Your task is to replace every occurrence of the substring "pi" with "3.14" using recursion only. You are not allowed to use loops or built-in replace functions. Return the modified string after all replacements.
Example 1
Input: s = "pip"
Output: "3.14p"
Explanation: The substring "pi" is replaced with "3.14".
Example 2
Input: s = "pipi"
Output: "3.143.14"
Explanation: Both occurrences of "pi" are replaced.
Example 3
Input: s = "apple"
Output: "apple"
Explanation: Since "pi" is not present, the string remains unchanged.
Sign in to write, run, and submit your solution against the full test suite.