WA in cipher AC in Decryption

I submitted a solution for Decryption(CF01 Problem - CodeChef) and got AC : (CodeChef: Practical coding for everyone)

I find the this problem similar to it Cipher (CodeChef: Practical coding for everyone) and submitted the same solution (CodeChef: Practical coding for everyone) but got WA …

Actually i took part in a contest and faced the question Cipher which i couldn’t get AC … I practiced later at Decryption and found that my logic was “seemingly” correct but not getting AC on Cipher… Can anyone please point out my mistake in understanding the two questions… Thanks in advance

Desperately in need of some help here :frowning: