We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def merge_the_tools(string, k):
subs = []
word = ''
for i in range(1,len(string) + 1):
if string[i-1] not in word:
word += string[i-1]
if i % k == 0:
subs.append(word)
word = ''
for j in range(0, len(subs)):
print(subs[j])
Cookie support is required to access HackerRank
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 →
My code:
def merge_the_tools(string, k): subs = [] word = ''