You are viewing a single comment's thread. Return to all comments →
def merge_the_tools(string, k): for i in range(0, len(string), k): # Split into k-sized substrings substring = string[i:i + k] seen = set() result = "" for char in substring: if char not in seen: # Preserve order, remove duplicates seen.add(char) result += char print(result)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Merge the Tools!
You are viewing a single comment's thread. Return to all comments →