Koi bhi test case par pass nhi ho rha hai

#include <bits/stdc++.h>
using namespace std;
void solve(string inp,string out,int n,int i)
{
if(i==n)
{
cout<<out<<" ";
return;
}

int digit=inp[i]-‘0’;
char ch=‘a’+digit-1;
out.push_back(ch);
solve(inp,out,n,i+1);
out.pop_back();
if(i+1<n)
{
int digit2=inp[i+1]-‘0’;
int no=digit*10+digit2;
if(no<=26)
{
char ch=‘a’+no-1;
out.push_back(ch);
solve(inp,out,n,i+2);
out.pop_back();
}
}

}
int main() {
string inp;
cin>>inp;
int n=inp.size();
string out;
solve(inp,out,n,0);
}

hi @tarunkumar08yadav there should not be comma after last element printed, you can do this

    for(int i=0;i<v.size();i++)
	{
		cout<<v[i];
		if(i != v.size()-1)cout<<", ";
	}

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.