Given a set of characters and a positive integer p, I have to print all possible strings of length p that can be formed from the given set.
for eg: if the set is {a,b}
and the value of p is 2
Output is: aa,ab,ba,bb
I know that for a given set of size n, there will be np possible strings of length p.
What is the best method that can be used to print all the possible strings.? I just want an approach to solve.
I'm using C.