Skip to content

Commit 178fdbf

Browse files
authored
Merge pull request #19 from HighnessAtharva/patch-2
Create MergeTools.py
2 parents 0db5d03 + 6a0902f commit 178fdbf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Strings/MergeTools

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'''
2+
Title : Merge The Tools!
3+
Subdomain : Strings
4+
Domain : Python
5+
Author : Atharva Shah
6+
Created : 15 March 2021
7+
Problem : https://www.hackerrank.com/challenges/merge-the-tools/
8+
'''
9+
from collections import OrderedDict
10+
11+
def merge_the_tools(string, k):
12+
for i in range(0, len(string)-k+1, k):
13+
print(''.join(OrderedDict.fromkeys(string[i:i + k])))
14+
15+
if __name__ == '__main__':
16+
string, k = input(), int(input())
17+
merge_the_tools(string, k)

0 commit comments

Comments
 (0)