Ad
  • Default User Avatar

    If n is less than zero or more than or equal to the available strings, the function must return NULL.

    "more than" ("zero\0one\0two\0\0many", 4) isn't tested: https://www.codewars.com/kata/reviews/66ca922c180b675e18865bb3/groups/66ce1f23bf5043bfb07639f1

  • Default User Avatar

    While thinking about a better way to write it, I did the same thing accidentally. Well, it just shows a property of this sequence.

  • Default User Avatar

    It doesn't seem clear from the description if the same value can appear in multiple layers.

  • Default User Avatar

    The initial solution has function twoOldestAges.

  • Default User Avatar

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

  • Default User Avatar

    if only some (but not all) the elements in the sequence are True

    JavaScript:

    Failed for 
    seq : [  1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0,  0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1,  1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0,  0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1,  0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1,  1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]
    pred : function parseInt() { [native code] }
    reason : expected false to equal true
    

    but parseInt never returns true...
    Now trying truthy instead of true:

    Failed for 
    seq : Iterator [
      true,  true,  true,  true,  false, false, false, true,
      true,  false, false, false, false, false, true,  true,
      false, true,  false, false, true,  false, true,  false,
      false, false, true,  true,  false, true,  false, false,
      true,  true,  true,  false, false, false, true,  false,
      true,  false, true,  true,  true,  false, true,  false,
      false, false, true,  true,  false, false, false, true,
      false, true,  false, true,  true,  true,  true,  false,
      true,  false, true,  false, false, true,  false, true,
      true,  false, false, true,  true,  true,  true,  true,
      true
    ])
    pred : function parseInt() { [native code] }
    reason : expected false to equal true
    

    but parseInt never returns a truthy value here...

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar
  • Default User Avatar

    IDK about edge case coverage, but out-of-bounds coordinates are still reported as "TypeError: result.forEach is not a function".

  • Default User Avatar

    The random tests in Lua have multiple missing and repeated numbers.

  • Default User Avatar

    Someone else approved the translation. I've done minimal fixing.
    Missing tests with unsorted arrays, misssing random tests.

  • Default User Avatar

    LLVM has troubles optimizing loops with inclusive upper bounds: https://github.com/rust-lang/rust/issues/45222

    Technically, it does apply to this case, but this loop isn't vectorizable and my guess is that unrolling won't help with this division, so it doesn't really matter here.

  • Default User Avatar

    The test expect a TypeError for bool, but bool is an integer type in Python.

  • Default User Avatar

    The random tests capture the same mutable variable by reference.

  • Loading more items...