You are viewing a single comment's thread. Return to all comments →
from itertools import combinations_with_replacement word , length = input().strip().split() word =sorted(word) length = int(length) combination = combinations_with_replacement(word,length) for combo in combination: print(''.join(combo))
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
itertools.combinations_with_replacement()
You are viewing a single comment's thread. Return to all comments →