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 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
very very clever
guess what? I am noob no.1
Wrong algebra. Cod is working perfect but statistic results will unpredictable for small classes. You shoul add your points and yourself to class points see description
Say your peers scores are x1, x2,..., x{n-1}, and yours is a.
Then you want to show that a is greater than the average, written as an inequality you get:
(x1 + x2 + ... + x{n-1} + a) / n < a
Where n is the total number of grades including yours.
Now multiply both sides by n to get
x1 + x2 + ... + x{n-1} +a < n * a
Subtract a on both sides
x1 + x2 + ... + x{n-1} < (n - 1) * a
Now divide by (n - 1)
(x1 + x2 + ... + x{n-1}) / (n - 1) < a
The LHS is the average of the scores without taking into acount your score.
Hope this helps :-)
i like the unusual way
What if needle does not exist in haystack ?!
Teacher, give me a zero, it's really bad. How do you calculate the average if you don't include yourself?
i'm crying:(
Loading more items...