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.
Who on earth voted this Best Practices?
I'm confused by one thing in the problem description: it seems to me that each 'iteration' of altering the population
But how can you have a population the same size if every iteration always increases the population by two?
What am I missing?
Your solution has a high time complexity. If you don't know what that is, now would be a good time to find out, since you're 4kyu.
This is beautiful and would be greatly improved if it was production code with one comment.
Here's why: the code would be broken if at ANY point any of the 'subtraction' tokens came before the un-modified token.
What I mean is: if C was listed in the hash before CM, or I before IV, and so on.
In fact, this code also relies on the fact that Ruby maintains hash order, but that is not strictly guaranteed by MRI. However, in practice I don't think anyone runs into hash order being a problem.
No, my main concern was that there should be a comment to the effect "Make sure subtraction tokens are listed before un-modified tokens (e.g. C before CM, I before IV)".
I think the kata description should specify that it should be able to handle arrays as well as strings.
This comment is hidden because it contains spoiler information about the solution
The problem statement implies m will be nonzero: "Your task is to return to the function seven(m) (m integer >= 0)"
The problem statement should be reworded if the input can be negative.
It's worse than that--the problem statement implies that m will be nonzero: "Your task is to return to the function seven(m) (m integer >= 0)"