These Romans are crazy!

By the rule set provided “IIVX” would be equivalent to 13, however the test case provides “XIII” which also follows the rules. Are there additional rules to roman numerals that haven’t been provided?

“The character I just before an V or X has a value of -1 (example IX equals 9)”
only possible with one caractere I, not two …

Additional rules : bigger to the left, smaller to the right…

Ah ok, thank you!

I got 3/4 Validators correct. It would help to know what is being asked for in Validator 4. Thank you.

“M has a value of 1000 (maximum 4 in a row)”…

1 Like

no further comments

Any hint with validator 3? All the tests pass and I’ve tried a lot of edge cases up to 4999, can not find the error with Val 3. Thanks!

Haven’t done this puzzle yet on CG so I cannot access the validator and I’m on my phone so it will be complicated to solve it from here but a general advice:
The key to avoid all edge cases for this one is to list all numbers that have a special written form in decreasing order:
1000, 900, 500, 400, etc.
Then for your decimal->roman converter you only need successive integer divisions by the numbers from your list.
The roman->decimal is easy to do at this point, just use the same list and reverse the process.
It should handle all edgecases.
And once your 2 converters are ready to go, the puzzle is basically over.


Thanks for the help, found it by giving it a list of edges cases. Wasn’t processing 49 correctly.

1 Like