This post was flagged by the community and is temporarily hidden.
I code in C++. So, I can’t tell you whats wrong with your code but I can tell you about NZEC error (Common in C++/Java)
Why do I get an NZEC?
NZEC stands for Non Zero Exit Code. Usually this error occurs when the code returns a non-zero value from main() function or if you omit an return 0; from the code. Other languages like Java/C++ could generate this error if they throw an exception which was not caught (e.g. Trying to allocate too much memory in a vector).
So for Java : NZEC will usually mean that your program either crashed or raised an uncaught exception.
@amitt001 Yes it was an ArrayIndexOutOfBounds Exception. thanks I have added an update to the post. please let me know if you have anything else to suggest regarding the TLE.