armstnp/Scala-Kata — pull request #2 by armstnp (2014-12-15 07:59:15+00:00)
Title: Add the Roman Numeral to Arabic kata.

This one surprised me in its relative difficulty. There are more validation hoops to jump through here, and it makes things rather tricky to manage. I thought about using a sort of map to keep track of which subsequences could be followed by which other subsequences, but then realized that was another way of expressing a regex. Thus, the final validation is nothing more than a regular expression. Sweet!

Other than that, the algorithm is very much a counterpart to the original, where the 'max munch' of the numeral is consumed at each step, with the highest subsequences considered first.