You are viewing a single comment's thread. Return to all comments →
from itertools import permutations if __name__ == '__main__': s = input().split() ans = sorted(list(permutations(s[0],int(s[-1])))) for item in ans: print("".join(item))
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 →