what is the problem with the following code,it is not accepting it,
even though the given sample cases are being passed,when i tried with run-code
#include<bits/stdc++.h>
using namespace std;
int ticks=0;
void finds(string s,string ans,int i)
{
if(abs(i)>=s.length())
{
if(ticks==0)
cout<<ans;
else
cout<<", "<<ans;
ticks++;
return;
}
int val=s[i]-‘0’;
char t=val+‘a’-1;
finds(s,ans+t,i+1);
if(abs(i+1)<s.length())
{
int val2=s[i+1]-‘0’;
int finval=val*10+val2;
char m=‘a’+finval-1;
finds(s,ans+m,i+2);
}
}
int main() {
string str,ans;
cin>>str;
cout<<"[";
finds(str,ans,0);
cout<<"]";
return 0;
}