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.
I could be wrong but I think your tree is still valid after removing 4. It would be invalid if right subtree value were smaller than the value or left subtree value were bigger. Might be a problem with test expectations.
Thanks!
Clear expectations do not negate the value in finding a solution. This particular kata is unclear enough to benefit from clear submit errors. I would still recommend changing from Test.expect to Test.assertEquals and if you are worried about people gaming the submit tests you can create a random array of values where you can compare the results with your own implementation.
Example:
I would include this as well:
As an aside the test errors are clearer when using assertEquals.
I'm getting an error when submitting: TypeError: Cannot call method 'join' of undefined
My test passes: Test.assertSimilar(prime(23), [2,3,5,7,11,13,17,19,23]);
15 and 21 are not prime numbers. i get [2,3,5,7,11,13,17,19,23]
this was fun. personal best
yes it's referring to add(1) == 1
The test failure message that ensures storing own data was not clear but this was the best kata I've done so far. Maybe consider adding that test to the default and not just for the submission process.