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
Honest boy, I am moved for your honesty, but I cheated on you.
This Kata is not a simple calculation of the average, the sentence is just a hint, give you a thinking direction.
For your honesty, give you more tips: the way to calculate the average value is often used in sports competitions.
Finally, thank you for your attention to this kata!
The average is not the solution for this kata, so your issue and statement is wrong...;-) That there's no example is just the special thing here and gives the title for these "thinking and testing katas"...
Test cases on submit are completely wrong. The average of [1, 1] is 1, not 0. The average of [1, 1, 2] is 1.33, not 0. Test cases are missing message.
function name in solution template should reflect what the user is trying to solve. For example, this one should be called
average
. An explaination should be added to the description about this 'lesson' and what problem the user is trying to solve. An example provided in the description is very helpful. I would recommend adding an example there.A lot of repeated code here.. remember the DRY principle.
tmp is pretty ambiguous. For readability/maintainability, you might want to call tmp 'sum'