What is error in the code

plz check it i’m getting the compilation error

Hello @mohitsingh you have not shared your code and i can see you have not tried for submission so i am not able to see your code.
please share it by saving it on ide.codingblocks.com

#include<bits/stdc++.h> using namespace std; string remo(string s){ if(s.length()<=1){ return s; } string res=remo(s.substr(2)); if(s[0]==‘p’&& s[1]==‘i’){ string p=“3.14”; return p+res; }else{ return s[0]+s[1]+res; } } int main() { int t; cin>>t; while(t–){ string s; cin>>s; cout<<remo(s)<<endl; } return 0; }

@mohitsingh
S.substr skips 2 characters, so you should call this only when string matches to “pi” else skip one character only.
i have updated your code, look for the comments for more explanation https://ide.codingblocks.com/s/421051

sir isme compilation error kyu aa raha aur mere approach me kya dikkat h pehle recursion call kiya phir apna s[0] or s[1] ko check kar lo

sir logic samaj aa gaya lekin isme compilation error kyu tha syntax kha galat tha

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.