Merge the Tools!

  • + 0 comments

    def merge_the_tools(string, k): # your code goes here stlist = [] c = 1

    for char in string:
        if char not in stlist:
            stlist.append(char)
        if c == k:
            output = "".join(stlist)
            print(output)
            stlist.clear()
            c = 1
            continue
        c +=1     
    

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