我有两个输入文件: sentances.txt This is a sentance with keyword one two three.
This is a sentance with keyword four five.
This is a sentence with keyword six.
keywords.txt one two three
four five
six
我给出了一个字母序列并且必须产生给定序列的所有N长度字母,其中N是序列的长度。 我在python中采用了一种有点天真的方法,在那里我采取了所有的排列方式来实现这一点。我发现了一些类似的线程,如this one,但我更喜欢Python中的数学导向方法。那么,什么是置换的更高性能替代?下面的尝试有什么特别的错误吗? from itertools import permutations
def fin