Created
March 7, 2017 23:29
-
-
Save rjshekar90/8ed5203632caa7eed59c2d1d8c500189 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations_with_replacement | |
S,K = raw_input().split() | |
print "\n".join("".join(i) for i in list(combinations_with_replacement(sorted(S),int(K)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment