Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This solution has the undesirable side effect of emptying the input array. But hey, it's O(n) time and O(n) space complexity.
(a.pop()|0) + (b.pop()|0)
works (same effect as doing~~
)Fails this test:
Test.assertEquals(high('man i need a taxi up to ubud taaxi'), 'taaxi');
Programmer error. My debug wasn't outputting the input value of a call that recurses. I can see the problem now, thanks.
My code passes all other tests including the random ones. Just one test it fails on.
So I had already (before reporting) added a console.log to try and debug so I can see that the input is 43, and yet it fails with
Log:
43, 7 (the output from the console.log(original number, returned sum))
Expected: 9, instead got: 7
I labelled it an issue because it seemed to be an issue in the tests.
JavaScript: One of the basic tests, 43 asserts the answer should be 9, but the answer should be 7.