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

  • Default User Avatar

    Killed it. Thanks.

  • Default User Avatar

    I've added the last two tests.

    Also, I've changed the structure of the random testing. See if it works now.

  • Custom User Avatar

    I should clarify these are working in the basic sample tests but not in the final random tests.

  • Custom User Avatar

    Maybe I wrote down the wrong one because I see that [2,3,6] does work but here are more examples that are expecting false but I think should be true:

    [2,6,9,4,5], 14

    9+5 = 14


    [2,4,8], 12

    4+8 = 12


    [5,6,4,8,1], 12

    4+8 = 12


    [7,2,3,1,6,5], 11

    6+5 = 11

  • Default User Avatar

    Not sure what you are referring to. [2,3,6], 9 works just fine in the JS test cases. For your comfort, I have added it as one the of the test cases. Refresh and you will see.

  • Custom User Avatar

    Some tests (JS) seem like they should be true but are expecting false. For example:

    [2,3,6], 9
    
    It should work for random inputs too - Expected: false, instead got: true
    

    3 + 6 = 9
    9 % 9 = 0 // true

    [3,9,5], 14
    
    It should work for random inputs too - Expected: false, instead got: true
    

    9 + 5 = 14
    14 % 14 = 0 // true

  • Default User Avatar

    Test cases updated.

  • Custom User Avatar

    Ok so it's supposed to include the duplicate strings in the solution. That's fine but you shoud update your test cases otherwise it's very confusing.

  • Default User Avatar

    Your code is incorrect.
    Actual and expected are flipped for JS.

  • Custom User Avatar

    Are the test cases correct? My solution is outputting the correct value based on the information in the testing case but still flagging it as incorrect.

    For example:

    arg a -> [ 'abcdefgh','fghi','abc','fghijk','fghij','fghi','fghij','abcd','efghij','cdefghij' ]
    arg b -> [ 'abc', 'abc', 'fghij', 'fghijk', 'abc' ]
    My result -> [ 1, 2, 1 ]
    

    Test case returns:

    It should work for random inputs too - Expected: [1, 2, 1], instead got: [1, 1, 2, 1, 1]
    
  • Custom User Avatar

    You said to "Look at the args and map it to something else" but I can't seem to get that to pass. I've tried the obvious but that doesn't seem to be correct (returning args as an array, using array methods on the args, returning nothing, returning 'pointless', etc.).

    Is there any logic or formula required at all?