Recursive Sequence Version 2 Failed Testcases

This is my code https://ide.codingblocks.com/s/351372 for the Recursive Sequence 2 from Spoj: https://www.spoj.com/problems/SPP/ or CB: https://online.codingblocks.com/app/player/115281/content/73626/5125/code-challenge.

My code successfully passed all testcases in CB platform but when i submit in SPOJ the code failed. Additionally i cross checked with one of the debug testcases given by one of the fellow problem solver. The first and last answer in the debug case differed. Can you help me to debug this. I think the problem may be with modulus operation as my code works fine for smaller or certain cases only for certain other cases it outputs a different answer.

Hey @Dancool32
Your code looks good ,I am not able to debug it.
Passing it to other TA’s :slight_smile:

Ok. Thank you for taking the effort though.

1 Like