You are viewing a single comment's thread. Return to all comments →
from itertools import combinations
a , b = input().split() b = int(b)
for s in range(1,b+1): for j in combinations(sorted(a),s): print(*j,sep="")
Seems like cookies are disabled on this browser, please enable them to open this website
itertools.combinations()
You are viewing a single comment's thread. Return to all comments →
from itertools import combinations
a , b = input().split() b = int(b)
for s in range(1,b+1): for j in combinations(sorted(a),s): print(*j,sep="")