We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
itertools.permutations()
itertools.permutations()
Sort by
recency
|
929 Discussions
|
Please Login in order to post a comment
For Python3 Platform
`Here is code:
`
My simple solution
from itertools import permutations
s, k = input().split() k = int(k) s = sorted(s) ans = list(permutations(s,k))
for i in ans: print(''.join(i))