question:- string encoding
arya has two strings S and T consisting of lower case english letters.
since he loves encoding the strings, he dose the operation below just once on the string S
first, arya thinks of a non- negative integer K then he shifts each character of S to the right
by K
explanation:- 1) in the first example the given strings are S= abc and T= ijk.
when arya chooses K=8
"a" is shifted to the right by 8 and become "i"
"b" is shifted to the right by 8 and become "j"
"c" is shifted to the right by 8 and become "k"
2) in the second example, the given string are S=ppq and T=qqp
there is non-negative integer K that arya can choose to transform S into T so, No should be printed.
input: abc
ijk
output: Yes
input: ppq
qqp
output: No
list1 = [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]
string1 = input('')
number = int(input(''))
print(list1[list1.index(string1) + number])
Comments
Leave a comment