You are viewing a single comment's thread. Return to all comments →
test case not running properly
Try it again. It did for all of us.
I tried the same codes but I get '-1' for the test case of N = 3. So what happens in the case of if N % 3 == 0? Sorry I might have missed something.
You copied it wrong; if else statement won't be inside the while...