In Java solution of the following problem, getting NZEC on closing bufferedReader.


I have been solving the following question.
the question is an easy one.
My question is regarding this solution.
if i keep br.close() in the code, codechef judge gives runtime error.
if i remove this, then my code is accepted.
I am facing the same problem in many codes.

Can anyone please help.

Thank you very much

Brother, remove .close(). When a file is “opened,” the OS marks the file as locked, generally so it can’t be deleted by other processes while it’s being used. x.close() undoes the lock, allowing the OS and other processes to do what it wishes with the file. I’ve answered it in recent post : & your corrected code: