#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 进行凯撒解密
# @param password string字符串 旺仔哥哥的密码
# @param n int整型 每个字符加密过程中错位的次数
# @return string字符串
#
class Solution:
def decodeWangzai(self , password: str, n: int) -> str:
# write code here
s = []
for i in range(len(password)):
a = ord(password[i]) - 97
b = (a-n) % 26
c = chr(b+97)
s.append(c)
return ''.join(s)

京公网安备 11010502036488号