Ad
  • 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).