You are viewing a single comment's thread. Return to all comments →
Simple Solution
from itertools import combinations_with_replacement s=input().split() s[0]=sorted(s[0]) k=list(combinations_with_replacement(s[0],int(s[1]))) for i in range(len(k)): print(''.join(k[i]))
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 →
Simple Solution