// Take as input str, a string.
// Assume that value of a=1, b=2, c=3, d=4, …. z=26.
// Write a recursive function (return type Arraylist)
// to print all possible codes for the string.
// E.g. for “1123” possible codes are aabc, kbc, alc, aaw, kw.
#include <iostream>
#include<algorithm>
#include<string>
using namespace std;
int y =0;
string final[1000];
void convert(char *inp, char *out, char* alpha, int i, int j)
{ // base case
if (inp[i] == '\0')
{
out[j] = '\0';
final[y++]=out;
// cout << "answer --" << out; cout << endl;
return;
This file has been truncated. show original