I am coding the algorithm in PHP and I am not passing 3rd validator. I have no clue what’s wrong with my code. I wonder if you can give me any intel to guess why it fails in that validator (it passes all tests and validators 1, 2 and 4).
I have use my code in a sandbox with parameters “CXXIII” and “CCCXXI” and the answer provided is “CDXLIV”. The Test 3 is passed. The problem is the Validator 3. I don’t know why it fails when the Validator 3 checks it while Test 3 is passed.
I have tried my code in the sandbox running PHP 5.0.5, so I guess that’s not the problem.
Thanks for your answer. I can provide you a link to my code so you can test it yourself, but please check the Validator 3 is congruent with Test 3.
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?
Thanks!