PETERSON Nov cook off

My recursive soluton for this problem gives SIGSEGV, although its working for all testcases. Please help me find the problem?

Link to the solution: CodeChef: Practical coding for everyone

Your solution is using too much memory for boundary case and it throws runtime error.


  • I just make a test case with a cycle
    of ABCDE and repeat it 20000
    times
    . so it reached the boundry
    value. string length become 100000.
  • And it gives runtime error.
  • You can check here
  • codechef about SIGSEGV here

My code is working for the test case you mentioned. You can check 9WslYI - Online C++ Compiler & Debugging Tool - Ideone.com
Can you point out the exact mistake in my recursive code as other codes with the same logic were accepted.

1 Like

In this add one more case of same length
I add two more case and it shows RTE here
but it is NOT showing. U check it by yourself :slight_smile: