0

Sorry if this is a duplicate. It's hard to precisely ask what I need on Google without showing examples.

I want to use an array of chars that are the allowed characters, and then use a method (that has a length parameter) to return a list of all the possible strings using these allowed characters.

For example, if the char[] would contain 'A', 'B', 'C' and the given length would be 3 then the results would be

AAA, AAB, AAC,
ABA, ABB, ABC,
ACA, ACB, ACC,
BAA, BAB, BAC,
BBA, BBB, BBC,
BCA, BCB, BCC,
CAA, CAB, CAC,
CBA, CBB, CBC,
CCA, CCB, CCC

An exact answer with code is not necessary, as I'm trying to make this out of pure interest and for enjoyment, so hints are welcome to!

anthonytimmers
  • 258
  • 1
  • 8

0 Answers0