[Community Puzzle] Remainder Fantasy


All Testcases pass. but failed on validator 2 & 8
can some share the test input so try to figure out why

Here is an online tool to help you debug yourself. You can create as many custom inputs as possible to send to an api then receive the correct answers, for checking against the answers calculated by your code.

You need curl to send requests. Look for it and Install it if you do not have it yet.

curl --location --request POST 'cgpuzzle.herokuapp.com/remainder' \
--header 'Content-Type: text/plain' \
--data-raw '3
3 2
5 3
7 2

Copy the above command and edit it. The above command contains 4 lines of example input which you are going to replace by your custom inputs. Keeping the carriage return in the input data is important. Run it in command prompt or shell terminal.

Run it in terminal. Browser does not help.

Understand, but seeing that so many successful it’s hard to guess on what terms/inputs my solution fails

You can try random

found one issue

6 0
12 0
36 0

but fixing that didn’t solve it.
ps. I get some really weird, and wrong answers if do something like:

3 0
6 0
12 0
36 1

fixed it, hint. solving 1 modulo, might solve more

1 Like

Debug well done!

This is invalid input.
If N % 12 == 0, N must be a multiple of 12.
With the added requirement of N>=36,
N % 36 must be 0, cannot be 1

My source (only for validation purpose) did not check for this error and returned something weird.