You are viewing a single comment's thread. Return to all comments →
Here is Python 3 solution from my HackerrankPractice repository:
import itertools s = input().split() string, number = sorted(s[0]), int(s[1]) print(*list(map(''.join, itertools.combinations_with_replacement(string, number))), sep='\n')
Feel free to ask if you have any questions :)
itertools.combinations_with_replacement()
You are viewing a single comment's thread. Return to all comments →
Here is Python 3 solution from my HackerrankPractice repository:
Feel free to ask if you have any questions :)