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):
li=[]
for i in range(0,len(string),k):
temp=""
for j in range(k):
temp=temp+string[i+j]
li.append(temp)
dup=[]
for i in li:
temp=""
for j in i:
if j not in temp:
temp=temp+j
dup.append(temp)
for i in dup:
print(i)
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 →
def merge_the_tools(string, k): li=[] for i in range(0,len(string),k): temp="" for j in range(k): temp=temp+string[i+j] li.append(temp) dup=[] for i in li: temp="" for j in i: if j not in temp: temp=temp+j dup.append(temp) for i in dup: print(i)