Question: can this problem solved by recursion? Suppose you have 2 slots, each slot you can fill in one of the letters in A, B, C,
Suppose you have 2 slots, each slot you can fill in one of the letters in A, B, C, D. If you want to print out all the 16 combinations, you can use a nested-loop. How about if we have N slots? If N is from user input, we don't know how many lyers we need for the nested-loop. You need some other ways to finish this job. Task: Get a user input 1N10, print out all the 4N combinations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
