You are viewing a single comment's thread. Return to all comments →
# Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import combinations_with_replacement
char_input , length = input().split() char_input = ''.join(sorted(char_input.upper())) length = int(length)
combination = combinations_with_replacement(char_input,length)
for comb in combination: print(''.join(comb))
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 →
# Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import combinations_with_replacement
char_input , length = input().split() char_input = ''.join(sorted(char_input.upper())) length = int(length)
combination = combinations_with_replacement(char_input,length)
for comb in combination: print(''.join(comb))