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.
"weight" of 2000 and 11 are both 2. If 2 weights are equal, you sort them alphabetically ("as strings" was the phrase used in the Kata). Thus the output should be 11 11 2000 ...
At 100 chars currently. Trying to find a way to calculate distance between centers with less than 26 characters, as that seems to be the longest aspect.
Out of curiosity, why cap the maximum number of balls to 500?
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
I'm not enough of an expert to answer your question, but would like to mention that it is possible (though not necessarily better) to solve this without using switch or if statements.
Agreed!
Yes.
The way slice is used in this example requires the index to start at 1, rather than 0, which is why it doesn't work right. Interesting that none of the test cases catch it.
Your statement is generally corect although the specific test case you mention is wrong. You need another number in the 0th position to demonstrate the issue, such as [66, 1, -1].