Optimal algorithm for generating all combinations (order of letter matters) of a word
问题 I am looking for an algorithm (optimal) for generating all possible combinations of a word. For example: Given the word love , the following would be outputted: Generated words: 24 elov elvo eolv eovl evlo evol leov levo loev love lveo lvoe oelv oevl olev olve ovel ovle velo veol vleo vloe voel vole Given the word bell (note about the repeating l ), the following would be outputted: Generated words: 12 bell blel blle ebll elbl ellb lbel lble lebl lelb llbe lleb I have my own algorithm in