Ad
  • Custom User Avatar

    They're flipped everywhere.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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 or loop 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).

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    In random tests actual and expected are flipped:
    Expected: [], instead got: [32, 56, 72, 0, 40, 40, 24, 16, 48, 40]