This is my python code which works effectively
when I run it on codechef run button during yesterday competition, it gave me precisely the answer. But when I decided to submit it, it was saying runtime error when I submitted yesterday.
Does codechef want a specific approach or algorithm to be used on a problem? Or what is the cause of this error please.
cook your dish here
d = {“a”:1,“b”:2,“c”:3,“d”:4,“e”:5,“f”:6,“g”:7,“h”:8,“i”:9,“j”:10,“k”:11,“l”:12,“m”:13,“n”:14,“o”:15,“p”:16,“q”:17,“r”:18,“s”:19,“t”:20,“u”:21,“v”:22,“w”:23,“x”:24,“y”:25,“z”:26}
t = int(input())
for i in range(t):
c = int(input())
s = input()
t = input()
u = input()
v = input()
l = []
ans = ""
kl = list(d.keys())
vl = list(d.values())
for ii in range(c):
dif = d[t[ii]]-d[s[ii]]
ad = d[u[ii]] + dif
if ad > 26: ad = ad%26
l.append(ad)
id = vl.index(ad)
ans += kl[id]
print(ans)