• Custom User Avatar

    Looks like it's still necessary to mutate the input (currentScore) to succeed.
    You can't just make a copy (e.g newResult = [...currentScore]), update it and return - this solution won't make it in final Random Tests section.

  • Custom User Avatar

    Couldn't wrap my head around the last one in Sample Tests section: a vs gx .

    We got 4% for the common space character at the end. Where do the rest 5% come from?

    • Same number of letters? No.
    • Same number of digits? Oh no!
    • Same number of words? Well, probably - in case there were more than one word (separated by spaces) in each string. As from the desciption, this one won't add anything either. Or should we treat spaces themselves as words as well?

    I'm asking, because this was the only thing I had to hardcode to pass the kata. Even the 500 Random Tests were ok without that.

  • Custom User Avatar


    P.S. Was scary to consider for me, that equal chunks must as well take in account spaces between words (i.e., words can't be cut into two parts, for example).
    When I found the above proposal doesn't mean anything, it became a fine easy-to-do-thing.

  • Custom User Avatar

    I'm passing all the tests except, I guess, randomString method.

    Got this:
    Should not utilize the Codewars Test Fixture. Forbidden word found in method!

    What's meant by utilize the Codewars Test Fixture and which word is forbidden?
    I can avoid the above error by removing return statement from the method, but that definitely doesn't do the trick.

    UPD. Never mind, got that - a restriction of using 'random' or 'test' in syntax.

  • Default User Avatar

    Yes, Node v10.x is set by default.
    Well, I'll have a look at it once again later.

  • Custom User Avatar

    Hi catchaser, yes, you are right, the result must be 68. I don't understand why you are seeing this (all test cases expect "0"), I just checked and everything works fine for me. Probably something wrong with codewars' test runners? Are you using Node v10.x?

  • Default User Avatar

    No callback at all in that case, as far as I remember.

  • Custom User Avatar

    What was the callback function?

  • Default User Avatar

    Hi, Danil!

    [ 5, 8, 1, 7, 5, 0, 6, 4, 2 ], [ 5 ], [ 1, 0, 0, 0, 8, 3, 6, 3, 4 ] ]
    Failed!: expected 68 to equal 0

    Are we okay with that?
    Isn't it supposed to become [ 5, 8, 1, 7, 5, 0, 6, 4, 2 ], [ 5, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0, 0, 8, 3, 6, 3, 4 ] ] and afterwards be consequently summed? E.g 5+5+1, 8+0+0 etc?

    I pass all the tests and than, to solve, I have to apply that ugly hack with counting the number of array elements, as totally all the results in 'attempt' section await zero instead of positive number.

  • Default User Avatar

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

  • Default User Avatar
  • Custom User Avatar

    A = [1,3,3], sum = 2 returns false. You cannot use 1 twice.

    That example shows that numbers can be repeated, or do you mean something else?

  • Default User Avatar

    Didn't found that mentioned in the task, so:
    some of the large arrays DO have repeating elements, which might be important for some kinds of solutions (mine, for instance).

  • Default User Avatar

    As mentioned above, an 'AssertionError [ERR_ASSERTION]: Very first elem' is a tricky thing in javasript tests.

    All my code is, for example:

    const findUniq = arr => null;

    And yet I get this thing in 'should handle basic cases' section.

    What's wrong with that?

  • Default User Avatar

    Got it, thanks!

  • Loading more items...