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