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
agreed. could be done in a single loop which would be a better practice
is console.log meant to not be working?
No random tests specifically in javascript. this can be taken advantage of
have you checked that you return the code rather than print to console?
i dont know this language but be wary on future discussions that the issue tag is for issues in the kata not issues in your personal code. that would not need a tag at all.
basically think of it like this O(1) would be going the same speed no matter how many items inputted into the function, O(n) is the time it takes to complete the function is linear with how many items is inputted. so if we went through the items twice, it would be O(2n). and as shown above we have one loop inside another. meaning we go through that second loop multiple times and the outside one once. you would find this to be O(n^2) so say its 1 second per item for O(n), in the O(n^2) 6 items would take 36 seconds, 8 would take 64 seconds, etc, etc. kinda lengthy but i hope it helped
basically think of it like this O(1) would be going the same speed no matter how many items inputted into the function, O(n) is the time it takes to complete the function is linear with how many items is inputted. so if we went through the items twice, it would be O(2n). and as shown above we have one loop inside another. meaning we go through that second loop multiple times and the outside one once. you would find this to be O(n^2) so say its 1 second per item for O(n), in the O(n^2) 6 items would take 36 seconds, 8 would take 64 seconds, etc, etc. kinda lengthy but i hope it helped
This kata seems to be lacking any example test solutions so the only way to test if it works is by pressing the attempt button
Thank you for the contribution
Thank you i have added a test case and made it more clear, including an example.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Took me a long while to get this one as an 8 kyu, much harder than it first appears but satisfying to solve.