You are viewing a single comment's thread. Return to all comments →
def merge_the_tools(string, k): newstring = "" mystring = list(string) while len(mystring) != 0: for i in range(k): if newstring.__contains__(mystring[i]): continue else: newstring+=mystring[i] del mystring[0:k] print(newstring) newstring = "" if __name__ == '__main__': string, k = input(), int(input()) merge_the_tools(string, k)
Seems like cookies are disabled on this browser, please enable them to open this website
Merge the Tools!
You are viewing a single comment's thread. Return to all comments →