Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Basically have ruby check the syntax for you? :p
your solution passes :)
This comment is hidden because it contains spoiler information about the solution
I suppose it would.. looking back to when I solved it I'm not really sure why I chose to make them private, lol.
private
isn't needed to pass this kata. Would it help?You can argue that IVXX=14 or IVXX=16. It is 20 (XX) minus 5 (V) minus 1 (I), or it is 20 (XX) minus 4 (IV). That's the reason why we avoid using confusing numerals like that.
Arguably VIXX would be valid, but this code also won't like it. (This code returns 24, while we mean 20-6, or 20-1-5). But notice that the notation is rubbish anyway: XIV=14 or XVI=16, and both are shorter.
Actually, the definition of Roman numerals used in this problem only allows a single I before V or X, a single X before L or C, and a single C before D or M. No other "subtraction" is allowed. So all these weird cases discussed above cannot occur.
As the problem description states: "Modern Roman numerals are written by expressing each decimal digit of the number to be encoded separately, starting with the leftmost digit and skipping any 0s."
In other words: all these cases are handled properly by the code. And the code even extends on this, by supporting IM (as 999), VM (as 995), IIIIIIIIIIIIIIII (16), etc., which would also be non-ambiguous.
That's not a valid Roman number, why should the solution give a valid result?
This comment is hidden because it contains spoiler information about the solution
What language do you use? May you try submitting your solution instead of just testing it (it should allow me to see it).
Kind of annoying.. I have a working solution that just .. won't.. work.. in the codewars editor because of this issue
I keep getting an error stating that test fixtures can't be constructed properly when I attempt to use regex.. anyone else seeing this issue?
This comment is hidden because it contains spoiler information about the solution
nice solution!
x = create_chain_for_test(1000000,500000)
loop_size(x)
This comment is hidden because it contains spoiler information about the solution