We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
itertools.combinations()
itertools.combinations()
Sort by
recency
|
860 Discussions
|
Please Login in order to post a comment
from itertools import combinations as com S=input().split() a,b=S[0],int(S[1]) for i in range (b): for j in sorted(list(com(sorted(a), i+1))): print(''.join(j))