getting wa rrecipe help

tried many test cases but getting wa

my soln: CodeChef: Practical coding for everyone

problem link: RRECIPE Problem - CodeChef

ur getting WA because of integer overflow .take the modulus at each step (i.e r=(r * 26)%MOD) here is ur modified soln i just changed r=r * 26%MOD .got AC

1 Like