You are viewing a single comment's thread. Return to all comments →
def merge_the_tools(string, k):
l=[string[i:i + k] for i in range(0, len(string), k)] for i in l: print(remove_duplicates(i))
def remove_duplicates(text): seen = set() result = [] for char in text: if char not in seen: seen.add(char) result.append(char) return ''.join(result)
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 →
def merge_the_tools(string, k):
def remove_duplicates(text): seen = set() result = [] for char in text: if char not in seen: seen.add(char) result.append(char) return ''.join(result)
if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k)