Ad
  • Default User Avatar

    I do not think there is an issue here ? the Ruby reference solution returns 1 for args_count("abc").

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Tests in Ruby translation do not supply an expected value when failed.

  • Custom User Avatar

    Try it with a single for loop. Right now, you're looping through each character in input twice, effectively making the function take n^2 steps to resolve, where n is the length of input. e.g. If you do this with a string of 10,000 letters, it will take 100,000,000 steps to resolve.

  • Default User Avatar

    As I can see, doRandomTests ignores cnt, but everything is very slow already, so I think it should be OK for now; if anything, it can be updated later.
    The kata author is active, so waiting now...

  • Custom User Avatar
  • Default User Avatar

    Missing all kinds of tests (n = 2000000 etc) that are in the original and other translations. Although some of them may not be entirely necessary for good coverage, some are, so I'd suggest that they should be just copied.
    Solutions should receive copies of m or the reference solution should be called first, otherwise user's solutions can change the array.
    The reference solution should at least have a random name so that it can't be called from solutions or it could be a locally bound lambda.

  • Custom User Avatar

    Hello! Can someone approve my Ruby translation or give advice on what needs changing? I think my tests might be a bit too lenient, but I'm not certain.

  • Custom User Avatar

    Alright, thanks much clearer!

  • Custom User Avatar

    Read what dulot wrote up there.

  • Custom User Avatar
    [NORTH SOUTH SOUTH EAST WEST NORTH]
    [SOUTH EAST WEST NORTH]
    [SOUTH NORTH]
    []
    

    The second case doesn't comply to:

    (W<->E or S<->N side by side)

    Maybe this helps (written by dulot):

    Think of NORTH, SOUTH, WEST, EAST as chemical products. When NORTH and SOUTH or WEST and EAST are side by side they annihilate each other; they don't if they are separated by another element.

  • Custom User Avatar

    Please explain [NORTH SOUTH SOUTH EAST WEST NORTH] => [] but [NORTH WEST SOUTH EAST] => [NORTH WEST SOUTH EAST]

  • Custom User Avatar

    They're not, please, read the instructions again, specially, the Note at the end. That exact case is explained there.

  • Custom User Avatar

    Ruby tests are broken

    Case:
    Expected: ["NORTH", "WEST", "SOUTH", "EAST"], instead got: []

    Since N > W > S > E essentially take you in a circle if you travel the same distance each way, you'd end up at the exact same location.

  • Loading more items...