void  listAllRNAStrandsFor(const string protein, 
				   map<char, set<string>>& encodings, 
				   const string RNA, 
				   const set<string>& codes,
				   set<string>::const_iterator itr) 
{
	/* This is a void function.
	*  The base case will be that the iterator 'itr' is pointing to the end of codes, the set of strings.
	*  If itr is not at codes' end yet, then call  listAllRNAStrandsFor() with a substring of the protein
	*  that excludes the first character (protein.substr(1)) but uses the overloaded function
	*  void listAllRNAStrandsFor(const string protein, 
	*			          map<char, set<string>> &encodings, 
	*			          const string RNA = "");
	*  where the second parameter is encodings, but the third parameter uses string concatenation: RNA + *itr
	*  then make the recursive call listAllRNAStrandsFor(protein, encodings, RNA, codes, ++it);
	*  with the incremented iterator.
}

	/* Now the overloaded function will be defined like this:
	*  void listAllRNAStrandsFor(const string protein,
	*					  map<char, set<string>> &encodings,
	*					  const string RNA)
	*  {
	*		//if protein is the empty string (base case) then 
	*		//print RNA and
	*		//return
	*  		//otherwise listAllRNAStrandsFor(protein, encodings, RNA, encodings[protein[0]], encodings[protein[0]].cbegin());
	*/


int main() {
	map<char, set<string>> encs;

	// Amino Acid (char) ... is encoded by RNA sequences (set<string>)
	encs['I'] = set<string>{ "AUU", "AUC", "AUA" };                       // Isoleucine
	encs['L'] = set<string>{ "CUU", "CUC", "CUA", "CUG", "UUA", "UUG" };  // Leucine
	encs['V'] = set<string>{ "GUU", "GUC", "GUA", "GUG" };                // Valine
	encs['F'] = set<string>{ "UUU", "UUC" };                              // Phenylalanine
	encs['M'] = set<string>{ "AUG" };                                     // Methionine
	encs['C'] = set<string>{ "UGU", "UGC" };                              // Cysteine
	encs['A'] = set<string>{ "GCU", "GCC", "GCA", "GCG" };                // Alanine
	encs['G'] = set<string>{ "GGU", "GGC", "GGA", "GGG" };                // Glycine
	encs['P'] = set<string>{ "CCU", "CCC", "CCA", "CCG" };                // Proline
	encs['U'] = set<string>{ "ACU", "ACC", "ACA", "ACG" };                // Threonine
	encs['S'] = set<string>{ "UCU", "UCC", "UCA", "UCG", "AGU", "AGC" };  // Serine
	encs['Y'] = set<string>{ "UAU", "UAC" };                              // Tyrosine
	encs['W'] = set<string>{ "UGG" };                                     // Tryptophan
	encs['Q'] = set<string>{ "CAA", "CAG" };                              // Glutamine
	encs['N'] = set<string>{ "AAU", "AAC" };                              // Asparagine
	encs['H'] = set<string>{ "CAU", "CAC" };                              // Histidine
	encs['E'] = set<string>{ "GAA", "GAG" };                              // Glutamic acid
	encs['D'] = set<string>{ "GAU", "GAC" };                              // Aspartic acid
	encs['K'] = set<string>{ "AAA", "AAG" };                              // Lysine
	encs['R'] = set<string>{ "CGU", "CGC", "CGA", "CGG", "AGA", "AGG" };  // Arginine
	encs['-'] = set<string>{ "UAA", "UAG", "UGA" };                       // Stop codons
	
	cout << "The amino acids are LVFMCAGPUSYWQNHEDKER-.\n"
		 << "Enter a protein terminating with the \"-\" stop codon: ";
	while (cin >> protein) {
		listAllRNAStrandsFor(protein, encs);
		cout << "The amino acids are LVFMCAGPUSYWQNHEDKER-.\n"
			 << "Enter a protein terminating with the \"-\" stop codon: ";
	}
}
/* typical output:
The amino acids are LVFMCAGPUSYWQNHEDKER-.
Enter a protein terminating with the "-" stop codon: K-
AAAUAA
AAAUAG
AAAUGA
AAGUAA
AAGUAG
AAGUGA
The amino acids are LVFMCAGPUSYWQNHEDKER-.
Enter a protein terminating with the "-" stop codon: KI
AAAAUAUAA
AAAAUAUAG
AAAAUAUGA
AAAAUCUAA
AAAAUCUAG
AAAAUCUGA
AAAAUUUAA
AAAAUUUAG
AAAAUUUGA
AAGAUAUAA
AAGAUAUAG
AAGAUAUGA
AAGAUCUAA
AAGAUCUAG
AAGAUCUGA
AAGAUUUAA
AAGAUUUAG
AAGAUUUGA
The amino acids are LVFMCAGPUSYWQNHEDKER-.
Enter a protein terminating with the "-" stop codon: KI
AAAAUAGACUAA
AAAAUAGACUAG
AAAAUAGACUGA
AAAAUAGAUUAA
AAAAUAGAUUAG
AAAAUAGAUUGA
AAAAUCGACUAA
AAAAUCGACUAG
AAAAUCGACUGA
AAAAUCGAUUAA
AAAAUCGAUUAG
AAAAUCGAUUGA
AAAAUUGACUAA
AAAAUUGACUAG
AAAAUUGACUGA
AAAAUUGAUUAA
AAAAUUGAUUAG
AAAAUUGAUUGA
AAGAUAGACUAA
AAGAUAGACUAG
AAGAUAGACUGA
AAGAUAGAUUAA
AAGAUAGAUUAG
AAGAUAGAUUGA
AAGAUCGACUAA
AAGAUCGACUAG
AAGAUCGACUGA
AAGAUCGAUUAA
AAGAUCGAUUAG
AAGAUCGAUUGA
AAGAUUGACUAA
AAGAUUGACUAG
AAGAUUGACUGA
AAGAUUGAUUAA
AAGAUUGAUUAG
AAGAUUGAUUGA
*/