Ad
  • Custom User Avatar

    Or maybe you should find the difference between sort and sort! (note that mutating the input is a bad thing)

  • Custom User Avatar

    The following sorting snippet works in my IRB but doesn't work in the tests that are run.

    Maybe because your console automatically prints out the returned values?

  • Custom User Avatar

    I don't know what you confirmed, but it works in both MRI here.

  • Default User Avatar

    Issue clearly specified.

    "The following sorting snippet works in my IRB but doesn't work in the tests that are run."

    This is confirmed by adding a "p s.sort" in the code.

  • Custom User Avatar

    Issue not specified.

    This is a sample test. If you can't pass it, your code is 100% wrong.

  • Default User Avatar

    This seems broken on Ruby (both MRI versions). The following sorting snippet works in my IRB but doesn't work in the tests that are run.

    irb(main):001:0> a = ["turns", "out", "random", "test", "cases", "are", "easier", "than", "writing", "out", "basic", "ones"]
    => ["turns", "out", "random", "test", "cases", "are", "easier", "than", "writing", "out", "basic", "ones"]
    irb(main):002:0> a.sort
    => ["are", "basic", "cases", "easier", "ones", "out", "out", "random", "test", "than", "turns", "writing"]