Ad
  • Default User Avatar

    My Attempt failed becasue of timeout. Unfotunately I don't see how many Test case from how big pool passed. It would be fine to know where is my alghoritm. I only see that 0 passed 1 failed exit code -1.
    Could you please help me.

    Thanks

  • Default User Avatar

    Hi,

    I have the same issue even though I clear array which I use to pass next version of array for recursive function calls.
    def snail(array, Lista=[]):

    next call of thsi function is:
    snail(array, Lista)

    I don't understand why thi array isn't cleard in first call - each next step. Seems like these Test Cases do it recursively.

  • Default User Avatar

    Hi,

    Thank you for your replay!
    I jus figue out what was wrong. The example tests accepted None value. My function returned None in case when had to return False. I have added one if and it works perfectly.

    However I have still problem with other Kata. Could you plase try to helpe here?
    Kata name: Snail
    Time: 123ms Passed: 2 Failed: 1
    Test Results:
    Log
    []
    ✔ Test Passed
    Log
    [1]
    ✔ Test Passed
    Log
    [1, 1, 2, 3, 6, 9, 8, 7, 4, 5]
    [1, 1, 2, 3, 6, 9, 8, 7, 4, 5]
    ✘ snail([[1, 2, 3], [4, 5, 6], [7, 8, 9]]): [1, 1, 2, 3, 6, 9, 8, 7, 4, 5] should equal [1, 2, 3, 6, 9, 8, 7, 4, 5]

    When I do example test or run my code on PC autput is correct: [1, 2, 3, 6, 9, 8, 7, 4, 5]

    Any idea what may be wrong here?

  • Default User Avatar

    Hi,

    Could you please help to figure out what is wrong with my sollution?
    All "Example Test Cases" passed but all real cases failed as: "failed to validate"

    Output:

    Time: 94ms Passed: 15 Failed: 100
    Test Results:
    Example Test Cases
    should return true for valid coordinates (7 Passed, 0 Failed)
    should return false for invalid coordinates (8 Passed, 0 Failed)
    Real Test Cases
    should return the correct value for random cases
    ✘ 95,,,67362,,--1 failed to validate.
    ✘ 12.974.6...56, 16,,48546,479 failed to validate.
    ✘ 2,1,5,, -226, failed to validate.
    ✘ 177,657280--246,71937 failed to validate.
    ...

  • Default User Avatar

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

  • Default User Avatar

    Hi,

    I Think the 3-rd Test Case is wrong.
    I got such result:
    ✔ Test Passed
    ✔ Test Passed
    ✘ snail([[1, 2, 3], [4, 5, 6], [7, 8, 9]]): [1, 1, 2, 3, 6, 9, 8, 7, 4, 5] should equal [1, 2, 3, 6, 9, 8, 7, 4, 5]

    When I'm trying the same as my test it works well:

    array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
    expected = [1, 2, 3, 6, 9, 8, 7, 4, 5]
    test.assert_equals(snail(array), expected)

    Result:

    Time: 118ms Passed: 1 Failed: 0
    Test Results:
    ✔ Test Passed
    You have passed all tests! :)