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.
- Prepare
- Python
- Strings
- Merge the Tools!
- Discussions
Merge the Tools!
Merge the Tools!
Sort by
recency
|
2662 Discussions
|
Please Login in order to post a comment
This is the best and simplest solution:
def merge_the_tools(string, k): for i in range(len(string)): if i % k == 0: stry="" for j in range(k): if string[j+i] not in stry: stry = stry + string[j+i] print(stry)
if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k)
My code:
def merge_the_tools(string, k): subs = [] word = ''