Given a dictionary of alternatives {a: ['a1', 'a2'], b: ['b2', 'bbb']} take a string and print all possible versions eg.
{a: ['a1', 'a2'], b: ['b2', 'bbb']}
Output: ab -> a1b2, a1bbb a2b2 a2bbb
Any thoughts for an optimal solution?