Mapped strings problemm...please help

im not getting why my code is giving segmentation fault for some test cases like 121212…please view it…

here is the code–

#include<bits/stdc++.h>

using namespace std;

void func(string s,vector vec,int i){
if(i==s.length()){
for(unsigned int i=0;i<vec.size();i++)
cout<<char(vec[i]+64);
cout<<endl;
return ;
}

vec.push_back(s[i]-'0');
func(s,vec,i+1);
if(i<s.length()-1&&((((s[i]-'0')*10)+(s[i+1]-'0'))<=26)){
	vec.erase(vec.begin()+i);
	vec.push_back((((s[i]-'0')*10)+(s[i+1]-'0')));
	func(s,vec,i+2);
}

}

int main(){

string s;
cin>>s;
vector<int> vec;
func(s,vec,0);

return 0;

}

please save your code on the online ide

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.