Ad
  • Default User Avatar

    It´s easier if you use "if" to validate the occasions when you need to subtract

  • Default User Avatar

    Ah, thank you.

  • Custom User Avatar

    This is not a kata issue. You need to check the way that you're adding to the total. For every 'I' character, you add one. This is good for something like "III", but in roman numerals, the number four is written as "IV". So, where your code sees it as 6, (1 + 5), this is actually 4. For your code to work, you need to add some kind of conditional check that sees if this 'I' is part of an 'IV' or is just an 'I'

    Same issue with the roman number MDXLIV. This is M (1000) + D (500) + XL (40) + IV (4).

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution