I've been working on this program for almost 3 weeks, but I can not figure out how to do it. Let me know if you can help.

i have to write a programusing recursionto print a list of number possibilities from a given set of numbers of a given number of digits.

Sample input:

3 2

3 5 6

0

3 is the amount of numbers in the set.

2 is the amount of digits in the output numbers.

3 5 6 is the set of numbers

0 tells the program to quit

sample out put would look like:

33 35 36 53 55 56 63 65 66

so everything comes down to 1 function that i cant write recursively for the life of me.

iteratively, it is simple but that's not acceptable as a solution.

my program takes in the number set, sorts them by ascending, stores them in an array, and then ... blank.

i just cant get my mind to process this recursively. this program is an assignment so i can not post code.

let me know if you can help. thanks.