FIBOSUM problem


My code is not working I don’t know why. It seems correct to me.

Hey Ashutosh, Your code is almost correct but there is slight mistake. whenever you do (a-b)%MOD, alway do (a-b+MOD)%MOD. Since (a-b) could be negative, it’s modulo would give wrong result. So change line no. 49 and 61 accordingly.

how can it be negative?

in few cases a can be smaller than b because a is already modulo which range from 0 to MOD

okay cool. Thank you very much!