Every permutation of the alphabet up to 29 characters?

后端 未结 13 1321
攒了一身酷
攒了一身酷 2021-02-11 01:23

I\'m attempting to write a program that will generate a text file with every possible permutation of the alphabet from one character up to twenty-nine characters. I\'ve chosen 2

相关标签:
13条回答
  • 2021-02-11 02:26

    The easiest way I can think of to get every permutation from 1 char to 29 chars in pseudo-code:

    loop from i = 1 to 26^29 or 27^29 if you want to include spaces
    {
       convert i to base 26 or 27;
       translate each number to the corresponding letter;
    }
    
    0 讨论(0)
提交回复
热议问题