You should not post code in this manner.
so how should I post?
Please either format your code or link to your submission
okay done.I’m not getting why it is giving nrez error
I just tried this testcase:
3 6 2 1 3 1 371 629 595 ? 3 ? 2 ? 3 + 3 731 + 2 578 ? 2
and got no output from your program.
what is error.it is working for some other cases
I’ll leave you to debug that First, you should find out why nothing at all is being printed. Hint: An exception is being thrown and swallowed.
it is working now
I mean giving nrez error but that testcase is working
can anyone answer this?
I just tried this large (14MB), random testcase with your latest solution and it rapidly reached 3GB of RAM usage and then crashed:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Test$GraphNode.<init>(abbyankit-BACREP.java:201) at Test.main(abbyankit-BACREP.java:14)