You are viewing a single comment's thread. Return to all comments →
import sys from itertools import permutations for line in sys.stdin.readlines(): m, n = line.split() str = sorted(permutations(m, int(n))) for i in str: print(''.join(i))
Seems like cookies are disabled on this browser, please enable them to open this website
itertools.permutations()
You are viewing a single comment's thread. Return to all comments →