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.
They're flipped everywhere.
This comment is hidden because it contains spoiler information about the solution
Yes, I thought about this but I'm unsure how to fix it. I thought about using RubyVM::AbstractSyntaxTree to check if the method uses
for
,while
,until
orloop
but Codewars uses ruby 2.5.0 wich doesn't have the AST module.I also thought about making the length of the array random, but then you could just loop n times calling rmap (n being the size of the array).
This comment is hidden because it contains spoiler information about the solution
In random tests actual and expected are flipped:
Expected: [], instead got: [32, 56, 72, 0, 40, 40, 24, 16, 48, 40]