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
|
2633 Discussions
|
Please Login in order to post a comment
def merge_the_tools(string, k): for i in range(0, len(string), k): substring = string[i:i + k] result = "" seen = set() for char in substring: if char not in seen: result += char seen.add(char) print(result)
def merge_the_tools(string, k): for i in range(0, len(string), k): substring = string[i:i + k] result = "" seen = set() for char in substring: if char not in seen: result += char seen.add(char) print(result)
import textwrap
def merge_the_tools(string, k): # Break string into k-sized chunks segments = textwrap.wrap(string, k)
if name == 'main': string, k = input(), int(input()) merge_the_tools(string, k)
import textwrap