Ad
  • Custom User Avatar

    your solution has a bug that incorrectly handles four zeros in sequence
    example input data [9, 0, 0, 0, 0, 0, 9]
    your code will return [ 9, 0, 9, 0, 0, 0, 0, 0 ]

  • Custom User Avatar

    Hi I checked
    your code gives wrong result for
    this sequence [9, 0, 0, 0, 9, 1, 2, 0,
    1, 0, 1, 0, 3, 0, 0, 1,
    9, 0, 0, 0, 0, 0, 0, 9] can you check locally

    javascript kata tests output incorrectly expected results and obtained results from the user

  • Custom User Avatar

    you shouldn't post code like that; anyone can see it.

    I added the spoiler flag to your comment

  • Custom User Avatar

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

  • Custom User Avatar

    Fixed. MRI 2.5 should be disabled now.

  • Custom User Avatar

    This happens when you have MRI 2.50 selected. Tests work when you change them to MRI 3.

    I will try to disable 2.5.

  • Custom User Avatar

    For Ruby version, the tests are not valid
    Even if I change it manually in test sample, attempt will fail so it is not possible to validate the kata

    --> the method is not at the right position in the code, called before being defined
    #<NoMethodError: undefined method `do_test' for main:Object>

    --> the method 'expect' is valid for Rspec but not with the framework of Codewars
    --> should use Test.assert_equals instead

  • Custom User Avatar

    It is not a kata suggestion.

  • Custom User Avatar

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

  • Custom User Avatar

    This is not even an issue with spec, the kata generates the expected answer before passing the argument to the user's function. In this case, the user is mutating the list as they iterate through it, causing issues. I'm closing this issue.

  • Custom User Avatar

    There is a false value in that input as well as [] (an empty array). The actual input for that test is ['a', 0, 0, 'b', null, 'c', 'd', 0, 1, false, 0, 1, 0, 3, [], 0, 1, 9, 0, 0, {}, 0, 0, 9].

    expected [ 'a', 'b', null, 'c', 'd', 1, 1, 3, 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ] to deeply equal [ 'a', 'b', null, 'c', 'd', 1, false, 1, 3, [], 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ] means that your code returned [ 'a', 'b', null, 'c', 'd', 1, 1, 3, 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ], but it should have returned [ 'a', 'b', null, 'c', 'd', 1, false, 1, 3, [], 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ]. The message you copied does not mention the input to the function.

    This problem is caused by a bug in your code. For future reference, the issue tag is meant to be used when there is a problem with the actual kata. You can use the question tag if you need help with your own code.

    As to the reason this is happening, make sure your code isn't confusing false and [] with 0. 0, false, and [] are all falsey values, so it seems like your code might be confusing them.

  • Custom User Avatar

    I think this testcase is wrong

    expected [ 'a', 'b', null, 'c', 'd', 1, 1, 3, 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ] to deeply equal [ 'a', 'b', null, 'c', 'd', 1, false, 1, 3, [], 1, 9, {}, 9, +0, +0, +0, +0, +0, +0, +0, +0, +0, +0 ]

    In the first array there is no 'false' however the second array has a false for some odd reason.
    There is also not a square bracket in the first array, however there is one in the second array. Can you help me out ?

  • Custom User Avatar
  • Custom User Avatar

    i litrally had to go study this before answering it.

  • Custom User Avatar

    C#:

    • The input type should be params int[] ... to be in-line with the description about passing arguments
  • Loading more items...