Merge the Tools!

Sort by

recency

|

2615 Discussions

|

  • + 0 comments
    def merge_the_tools(string, k):
        for substring in range(0, len(string), k):
            print(''.join(dict.fromkeys(string[substring : substring + k])))
    
    if __name__ == '__main__':
        string, k = input(), int(input())
        merge_the_tools(string, k)
    
  • + 0 comments

    code

    def merge_the_tools(string, k): text = "" for i in string: text += "".join(i) if len(text) == k: for i in range(len(text)): s = "".join(sorted(set(text), key=text.index)) print(s) text = ""

  • + 0 comments

    def merge_the_tools(string, k): l = textwrap.wrap(string,k) ll = {} for i in l: d = {k: "None" for k in list(i)} print("".join(list(d.keys())))

  • + 0 comments

    Can I use set function for this problem?

  • + 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)