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.
@cilheo Did you figure out why you failed on Validator 4? I also failed it. I didn’t read the spec carefully (shame on me) and I only wrote my code to handle numbers up to 3999, the limit for Roman Numerals without the use of a vinculum according to EnglishHistory.net.