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.combinations_with_replacement()
itertools.combinations_with_replacement()
Sort by
recency
|
550 Discussions
|
Please Login in order to post a comment
from itertools import combinations_with_replacement
a,b = input().split() b=int(b)
for j in combinations_with_replacement(sorted(a),b): print(*j,sep="")
My short solution…