question : Contest Page | CodeChef

solution in java : Solution: 62103528 | CodeChef

solution in cpp : Solution: 62107508 | CodeChef

whats the problem in my java code please?

Check the following update to your code.


1 Like

Can you tell me why my code was giving error
And also i just noticed single change that is
Is it the only difference and if so then whats the problem in using nextLine()
Please tell me
Thank you

The only real difference between the accepted code and the buggy code is using the standard Scanner class available in java.util.* package.

It seems that the buffered Reader class declared in your code fails to read the program data correctly for some test cases, even though N \le 100 for all test cases.