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.
defmerge_the_tools(string,k):# while loop runs till the string becomes emptywhilestring:# splice the given strings=string[0:k]# initiate an empty string# (seen is just the name of our variable)seen=''# run a for loop through our spliced string (s),# appending only unique characters to our variable seenforcins:ifcnotinseen:seen+=cprint(seen)# remove the spliced part from original string for the next iterationstring=string[k:]
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 →