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.
Wow, I learn a lot.
This comment is hidden because it contains spoiler information about the solution
Now multiple valid solutions are possible.
Also, the encoding of the solution may be different, but the task is still a duplicate.
This has been modified to require the completed set as a result instead of just the value.
This is exactly the same as https://www.codewars.com/kata/house-robber/ ( except for that kata's senseless special case on
[]
).Please unpublish this duplicate kata.
Sounds good, I added the example
[6,1,2,7,3,5] -> 18
and cleaned up the test titles. It now does random (i+1 step) from 10 to 50 vertices and includes the input array to assist with debugging. The remaining random tests (i+10 step) from 50 to 1000 vertices do not include the input array.note: you still need an example like
[6,1,2,7,3,5] -> 18
in the description (the current version can let think that you only want pairs)it's just that if too much stuff is written to the console, the user can get a buffer limit error (but I guess your tests are still far from this. The other thing is that the test feedback isn't readable anymore if the arrays are too big)
It's currently performing a toString on the input array when constructing the title, which shouldn't have a limit. I don't believe chai has a title limit either, or at least I've never encountered one.
That said, I'm happy to truncate the title, especially if it exceeds a limit for code wars or if there is a coding standard that should be followed.
warning, do not display the input array if it's too big (edit: is that possible, actually...? I don't know chai...)
Thanks for the feedback. I made some changes.
hi,