Issue with code submission for problem code : CNOTE

I have two solutions listed below for problem : CNOTE Problem - CodeChef

AC : CodeChef: Practical coding for everyone
WA : CodeChef: Practical coding for everyone

Bot the solutions are identical except for one thing :
If i try to break the inner loop if a suitable notebook is found then the solution is stated as Wrong.
I am not able to understand why is this happening.
As per the problem statement, if a suitable notebook is found it should be good enough. I don’t see why we need to iterate through all the notebooks.
Can someone please help with what i am missing here ?