Ad
  • Custom User Avatar

    this will show error in some tests

  • Custom User Avatar

    It's been a while but all the words are split, so you'd need to do it for every word separately.

  • Custom 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

  • Custom User Avatar

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

  • Custom User Avatar

    That's what the 'if s' conditional determines, as an empty string '' s evaluates to not s

  • Custom User Avatar

    just a mistake, it shouldn't be there (surely a left over of a previous idea while coding)

  • Custom User Avatar

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

  • Custom User Avatar

    Alright i figured it out. Thanks for the help. Now i am just way too slow, so i hope i can shave down my time.

  • Custom User Avatar

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

  • Custom User Avatar

    I'll look into that. But shouldn't the test then expect an error instead of a result?

    You mentioned fixed test #38. If, for example, there was an error with a populate method that preceded test #38, then those blobs wouldn't be added to the population. But as I said, I've only taken a cursory glance so this might not be the cause of what you're encountering.

  • Custom User Avatar

    I'll look into that. But shouldn't the test then expect an error instead of a result?

  • Custom User Avatar

    I've only taken a cursory glance, but it may have to do with invalid inputs:

    If the list input contains any invalid values, discard it entirely and throw an error (do not update/modify the instance)

  • Custom User Avatar

    Fixed test 38 i get Error Detected: Expected - [[10, 7, 570]], but instead got [[12, 7, 582]], which i don't understand because when i print the board when the move(2000) comes in and i count all the integers in the board, i count up to 582, which my solution returns as the end size of the final blob, but the solution is expecting 570, which should be impossible since all blobs summed up will give 582. And if i try to print something in the populate function, nothing ever prints on that test so it never gets called? Besides my populate function misbehaving, i doubt my code is doing something wrong since all the other fixed tests run fine... Could someone give a little advice what is going wrong?

  • Default User Avatar

    COMMENT UPDATED AND CHANGED FROM QUESTION TO ISSUE
    (original comment is below, found issue described in reply)

    Coding in TypeScript - I am still getting first random test failed (all the other test are always passed, just first random test R#0 is failed) and no idea why, because sometimes it is really simple test case. Here is the example with logs:

    R#0: 18 floors, 45 people, lift holds 5
    Log
    input parameter result: [ 0, 1 ]
    queues: 
    [ [], [], [ 1 ], [] ]
    capacity: 4
    return: [0, 2, 1, 0]
    input parameter result: undefined
    queues: 
    [ [ 1 ], [], [ 1 ], [] ]
    capacity: 4
    return: [ 0, 1, 2, 1, 0 ]
    expected [ 0, 1, 2, 1, 0 ] to have the same members as [ 0, 2, 1, 0 ]
    

    It looks that there are actually 2 tests, and result from the first is the expected one ([0,2,1,0]), also second result is correct based on the input queues, but the second result is compared with expected result from first test and it is obviously failed.

    Another thing, I don't understand why there are required input parameters result and direction, as you can see in example above, in first test the input parameter result has assigned value [ 0, 1 ] and in second test it is undefined. Maybe this causes the issue, because the second result always contains this result parameter from first test at the beginning. Another example just to see it clearly:

    R#0: 6 floors, 6 people, lift holds 3
    Log
    input parameter result: [ 0, 1, 2, 3, 4 ]
    queues: 
    [ [], [], [ 4, 0, 3 ], [], [] ]
    capacity: 4
    return: [ 0, 2, 3, 4, 2, 0 ]
    input parameter result: undefined
    queues: 
    [ [ 1, 4, 4, 1 ], [ 3, 2 ], [ 3, 4, 0, 3 ], [], [] ]
    capacity: 4
    return: [ 0, 1, 2, 3, 4, 2, 0, 2, 3, 4, 0 ]
    expected [ 0, 1, 2, 3, 4, 2, 0, 2, 3, 4, 0 ] to have the same members as [ 0, 2, 3, 4, 2, 0 ]
    

    You can see that result from first test is expected result, and result from second test starts with the input parameter result from first test ([ 0, 1, 2, 3, 4 ]).

    It is really wierd that all the other complex tests are always passed, only this one fails.
    Am I missing something here or is this an issue of the test?

  • Loading more items...