You are viewing a single comment's thread. Return to all comments →
The shortest code I could write…
from itertools import * s, k = input().split() print('\n'.join(''.join(c) for r in range(int(k)) for c in combinations(sorted(s), r + 1)))
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 →
The shortest code I could write…