题解 | #字符串加密#
字符串加密
https://www.nowcoder.com/practice/e4af1fe682b54459b2a211df91a91cf3
src = di_chr = 'a b c d e f g h i j k l m n o p q r s t u v w x y z'.split(' ')
dst = 'a b c d e f g h i j k l m n o p q r s t u v w x y z'.split(' ')
paswd, instr = input(), list(input())
keyquchong = list(set(paswd))
keyquchong.sort(key=paswd.index)
while keyquchong:
di_chr.insert(0, keyquchong.pop())
di_chr = list(set(di_chr))
di_chr.sort(key=src.index)
for c in instr:
print(di_chr[dst.index(c)],end="")
