Merge the Tools!

  • + 0 comments

    def merge_the_tools(string, k): #number of parts cnt = len(string) // k #list of parts l = [string[i*k : (i+1) * k] for i in range(cnt)] #process each part for s in l: print(''.join([ s[i] for i in range(k) if s[i] not in s[0:i] ]))

    if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k)