We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 981105a commit c68ae4bCopy full SHA for c68ae4b
2010/Senior Problems/S2.py
@@ -0,0 +1,13 @@
1
+dict1 = {}
2
+for t in range(int(input(''))):
3
+ encoded_value = input().split(' ')
4
+ dict1[encoded_value[0]] = encoded_value[1]
5
+encoded_string = input('')
6
+decoded_string = ''
7
+index = 0
8
+for a in range(len(encoded_string)):
9
+ for k,v in dict1.items():
10
+ if encoded_string[index:index+len(v)]==v:
11
+ index=index+len(v)
12
+ decoded_string+=k
13
+print(decoded_string)
0 commit comments