• Custom User Avatar

    I may be wrong, but I don't think nested loops will work here.

  • Custom User Avatar

    The tests are fine. Hobovsky explained the confusion you seem to be having above.
    It seems that your code is simply buggy, in that is trying to unwrap the Result from parse(), which is invalid if the Result is an Error. This is why using unwrap is typically bad habit. Check your numbers before parsing them.

  • Custom User Avatar

    I checked the tests which the creator has made, and it seems that he / she / they are testing 2 different functions

    Not exactly. The kata wants you to perform the so-called "silly addition" every time. It;s just some inputs sometimes result in behavior identical to "normal addition". For example, when you do the "silly addition" with inputs 12 + 44, you will still get 56.

    See if this paragraph is of any help: https://docs.codewars.com/training/troubleshooting#print-input, and maybe raise a suggestion to make assertion messages clearer.

  • Custom User Avatar

    What's the first number in the array you build?

    Square all numbers k (0 <= k <= n) between 0 and n.

    What's the value of d in the tests you're failing? You can use console.log to print the input values.

  • Custom User Avatar

    Your code is failing one of the sample tests too, check that, and how you build you array, that'll help.