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.
Instructions aren't clear, probably because neither example looks like it's using one's or two's compliment. How is +6 equal to '11010'? Shouldn't it be '110' or '0110'?
Though, -6 being equal to'1110' makes sense if you're using one's compliment.
What does 1 and -1 look like? What does 2 and -2 look like? What does 3 and -3 look like?
Nevermind...negative base number systems. Missed that info.
Solution was to change !value to typeof value === 'undefined'.
When an element was 0, it was exiting the fn prematurely.
myjinxin2015, How are you formatting code in the comments?
Thanks for all the help! Your question about !value is for the case there's only one element in the original array.
Since, as you've correctly pointed out, sorted.shift() changes the array length, value will be undefined so this allows the function to exit with the correct value.
This comment is hidden because it contains spoiler information about the solution
It's odd, I keep getting different results for the submit tests. Sometimes I get 1 fail, sometimes 9 fails, sometimes 4 fails. But the tests I've written are consistent. And since there's no output for the tests other than 'failed' I cannot figure out WHY those tests fail.
Are you sure the tests that are being generated are correct?