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.
why you add 1?
thanks
class_points
does not includeyour_points
, so its length is the number of every other person in the class, which is why it does weirdly still makes sense to add exactly1
more for the calculation, even though it won't change the calculation...I think this solution is incorrect logically. The len function returns the length of the list meaning if there are 8 elements in the list, the len function returns 8. so adding 1 to it increases the length to 9 which is logically incorrect for the calculation of average with 8 elelment.
My view though
It was actually my solution, but then I read in the discussion that you don't have to add your points. However my mistake was in wrong placement of ">" :/
It is needed to add own score as there is a possiblity that you get an empty list (you alone wrote the test). This would result in division by zero.
I wanted to ask why it's redundant, because I thought that you are part of the class so your_score affects average score (which is true).
But when I was writing this comment I realized that although your score affects average it won't affect the overall answer for the question: "Is your_score higher then average in this class?".
The reason for this is that if including your_score in the average calculations increases average then your score was already higher then average so result won't change. The same happens if your score decreases average.
Maybe someone will find this explanation usefull so I'm leaving it here.
It has a redundancy in that it adds your points to the average, which isn't needed
Yes
Are you jalous?
Why people give this solution Clever?
Awesome, thank you. :)
Not sure how it passed validation in the first place, but I removed the include and the reference solution is still working. Should be good to go now.
Will look into upgrading the boost libraries and posting documentation in the near future :)
C++
Language?
Loading more items...