Interesting additional information, the rules that we consider normal for Roman numerals are actually a fairly modern invention. The simplest example is that IIII was often used instead of IV, and still is in some cases such as certain clocks. There were also cases of multiple leading subtractive symbols being used, such as IIXX for 18 instead of XVIII, due to how they spoke, in this case "two from twenty".
Such an interesting problem, seems simple on the surface, but the deeper you dig the more edge cases their are.
Passionate full stack web developer, course author for Educative, book author for Packt, he/him.
Find my work and get to know me on my Linktree: https://linktr.ee/thormeier
Thank you very much, glad you enjoyed it! I didn't know that, thank you! The code in the article is not really capable of handling, for example, the IIXX case, even though it probably wouldn't take much to cover that, too. It's something I really like about our number system today: There's only ever one way to write a number (that is, if you don't count mathematical expressions or complex numbers...)
(Sorry for the late reply)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Very fun puzzle and a great article as well!
Interesting additional information, the rules that we consider normal for Roman numerals are actually a fairly modern invention. The simplest example is that
IIII
was often used instead ofIV
, and still is in some cases such as certain clocks. There were also cases of multiple leading subtractive symbols being used, such asIIXX
for 18 instead ofXVIII
, due to how they spoke, in this case "two from twenty".Such an interesting problem, seems simple on the surface, but the deeper you dig the more edge cases their are.
Thank you very much, glad you enjoyed it! I didn't know that, thank you! The code in the article is not really capable of handling, for example, the
IIXX
case, even though it probably wouldn't take much to cover that, too. It's something I really like about our number system today: There's only ever one way to write a number (that is, if you don't count mathematical expressions or complex numbers...)(Sorry for the late reply)