B – Caesar Cipher
s = list(input())
t = list(input())
ok = False
for i in range(26):
if ok:
break
a = []
for j in s:
a.append(chr(ord('a') + (ord(j) - ord('a') + i) % 26))
if a == t:
ok = True
break
if ok:
print("Yes")
else:
print("No")
コメント