Skip to content

Commit fe5e61c

Browse files
committed
decrypt-string-from-alphabet-to-integer-mapping
1 parent 660519b commit fe5e61c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def freqAlphabets(self, s: str) -> str:
3+
decrypt_dict1={'10#':'j','11#':'k','12#':'l','13#':'m','14#':'n','15#':'o','16#':'p','17#':'q','18#':'r','19#':'s','20#':'t','21#':'u','22#':'v','23#':'w','24#':'x','25#':'y','26#':'z'}
4+
decrypt_dict2={'1':'a','2':'b','3':'c','4':'d','5':'e','6':'f','7':'g','8':'h','9':'i'}
5+
for key,value in decrypt_dict1.items():
6+
s=s.replace(key,value)
7+
for key,value in decrypt_dict2.items():
8+
s=s.replace(key,value)
9+
return s
10+
11+

0 commit comments

Comments
 (0)