Merge the Tools!

  • + 1 comment
    import textwrap
    from collections import OrderedDict
    
    def merge_the_tools(s, k):
        chunks = textwrap.wrap(s, k)
        for c in chunks:
            print("".join(OrderedDict.fromkeys(c)))
    
    def main():
        s, k = input(), int(input())
        merge_the_tools(s, k)
        
    if __name__ == "__main__":
        main()