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 have no idea why it worked. it could have been a bug in the tests
Not incorrect. That part of the kata is a red herring, wether the author intended that or not. Just think about it, if your score is the highest score it will always be above the average of all other scores and your score can never be low enough to make the average lower than itself. The code here is using sound logic.
the error is in the test code. At each test, it doesn't take into account the total number of items in the list ( your_points + class_points)
that's why it passes even with your code :)
It doesn't matter whether you add your own points or not, the answer will be the same either way.
it passed tho
Incorrect. The Kata says to include your own points into the average.
Despite the kata instructions saying to include your own scores, it is not necessary.
Wow, it's so laconically :) Interesting task!
i really didnt want this to be true , but well done .
Your points are not included in the array of your class's points. Do not forget them when calculating the average score!
I like tha math. I was assuming this is incorrect becuase of leaving your_points. But later, I realized that this is mathematically correct.Thanks to @Idiot_with_a_shovel - https://www.codewars.com/users/Idiot_with_a_shovel
kata included instructions to not calculate the user into the average
This is a clever use of exceptions, though I would avoid this in production code. Raising exceptions is costly, and also if "a" happens to be a long string you would be creating a string 50 times larger.
good use!
please do not post solutions in the discourse, otherwise anyone can see it without the spoiler flag. I have added the flag to your comment.
Loading more items...