1 2 3 4 5 6 7 8 9 10
import itertools line = ['A','B','%'] def line_permutations(line): if '%' not in line: return [line] line.remove('%') # use copy.copy if you don't want to modify your matrix here for i in range(len(line)): yield line[i:] + ['%'] + line[:i] permutations = itertools.product([line_permutations(line) for line in matrix]) print(permutations)
You have reached a limit of free submissions this month.
You cannot send submissions this month anymore because of exceeding your monthly limit. Please recharge your account.
the submission is still running...
- upload with new input
result: Runtime error time: 0.02s memory: 5852 kB signal: -1