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 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.
This comment is hidden because it contains spoiler information about the solution
This is incorrect. by not including your_points, you are not really calculating the average of the class
Thuis a brilliant codewar
If you're like me and read this comment and don't get the math explanation - plain english one is that if you add your points to the class average and your points cause that average to rise - that by default means your score was higher than the average of the class. That's why you don't need to add it in this particular example.
Quick Maffs!
Mate, this is the most intriguing and clever ways to solve this problem of summation. Hats off to you!
Pure math is alsways in theory faster. Learned this algo from a friend of mine, will always remember it for sum of range problems starting at 0 or 1
u sure that this is a good option? ty
Loading more items...