Unexpected behaviour of the codechef platform ..

I am unable to understand why the solution CodeChef: Practical coding for everyone gives the wrong answer while the solution CodeChef: Practical coding for everyone gives the right answer … The two codes according to me are the same .

Did you check it line by line? Did you compare the scanf("%s", &temp[i][j]) line in both?

Yes … Each line is same … The two different ways of writing scanf does not make any difference …
And here is the solution with the scanf written in the same way as in the accepted solution CodeChef: Practical coding for everyone but it also gives the wrong answer …

I meant in one code you are writing scanf(&temp[i][0]) another one you are writing scanf(&temp[i])

united states