posted 15 years ago
Sounds like a nested loop problem, except the number of nestings isn't fixed.
If it were fixed, say at 2 as per your example, there would be a nested loop with the outer one picking up one letter at a time and the inner loop then appending one letter at a time to the one from the outer loop.
Now think how to do this using recursion. Put the letters into a 2 dimensional array with the first index being the number and the second index being the letters for that number.
This is off the top of my head, of course.