You are viewing a single comment's thread. Return to all comments →
Python 3.x:
from itertools import combinations_with_replacement as combs s, k = input().split() print(*[''.join(p) for p in combs(sorted(s), int(k))], sep='\n')
Seems like cookies are disabled on this browser, please enable them to open this website
itertools.combinations_with_replacement()
You are viewing a single comment's thread. Return to all comments →
Python 3.x: