You are viewing a single comment's thread. Return to all comments →
from itertools import combinations a,b=input().split(" ") b=int(b) for i in range(1,b+1): for j in list(combinations(sorted(a),i)): print("".join(j))
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 →