I need to get all of the permutations of a string, but with a twist. I need to get the permutations, but at different lengths. Like this: the permutations of AB would be:
A
B
AA
BB
AB
BA
I can get the permutations of a string, with fixed lengths, but I'm stuck on this.