The task is to generate all the strings from 'a' to '999' including upper case characters like so:
'a', 'b', 'c' ... 'y', 'z', 'A', 'B', 'C' ... 'Y', 'Z', '0', '1', 2' ...
'8', '9', 'aa', 'ab', 'ac' ... 'az', 'aA', 'aB' ... 'aZ', 'a0' ... 'a9', 'ba'
and so on (filling in the gaps), optionally starting with the empty string.
Input:
- The amount of consecutive characters the program has to print up to.
Output:
- An array containing each string OR one string per line
Clarifications:
The order doesn't matter, you can print uppercase or lowercase letters first if you want.
The output can return any type of enumerable, doesn't have to be an array specifically, although I doubt printing all the combinations won't be the easiest way to go.
An input of
3
would print all the string from'a'
(or''
) to'999'
‚ an input of5
up to'99999'
and so on.
a = (function return)
. \$\endgroup\$a
to9999
, for 5 it'sa
to99999
, and so on. \$\endgroup\$