I tried coding this myself and horribly failed. This is basically what I want:
a
b
...
z
aa
ba
...
za
ab
bb
...
zz
aaa
baa
...
zzz
In the end it should have generated every string that is shorter then N characters with charset a-z. So I'm not looking for permutations (of which 1001 implementations can be found on the internet), but for combinations with replacement (at least that's how it's called in Python). Order is not important, speed is.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…