You are viewing a single comment's thread. Return to all comments →
been practicing again with python. not the simplest one, big hope to be more advance.
from itertools import combinations def combination(numbers): arr = [] val = sorted(numbers[0]) for x in range(1, int(numbers[1])+1): comb = sorted(list(combinations(val, x))) for x in comb: res = arr.append("".join(x)) return(arr) if __name__ == "__main__": numbers = input().split() res = combination(numbers) for x in res: print(x)
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 →
been practicing again with python. not the simplest one, big hope to be more advance.