Microsoft | Onsite | Dictonary of String versions
Anonymous User
326

Given a dictionary of alternatives
{a: ['a1', 'a2'], b: ['b2', 'bbb']}
take a string and print all possible versions eg.

Output:
ab ->
	a1b2,
	a1bbb
	a2b2
	a2bbb

Any thoughts for an optimal solution?

Comments (5)