MCOINS SPOJ problem

Recursive implementation of MCOINS fails in test case 19, please help me debug! Recursive version
Iterative implementation works Iterative version

1 Like

Hey @neilit1992 you just missed the less then zero check :stuck_out_tongue:
Changing line 26 to if(arr[i]>=0 && !f(arr[i])) fixes the bug.

1 Like

Thank you, your debugging skill is awesome!

1 Like

True that! Meoow and his debugging skillsā€¦