The issue described below is still present.
This is not new at all. Finding average has been done many times, this is literally just adding a "take every nth element" which has also been done.
i.e This is duplicate of these two katas combined:
https://www.codewars.com/kata/every-nth-array-element-basic https://www.codewars.com/kata/calculate-average
Even if the array elements are integers, because the final result is a float comparing equality directly will break because of floating point errors.
For example, if someone adds up the integers after dividing by the length, the result will be different.
Random tests are vulnerable to input modification.
Loading collection data...
The issue described below is still present.
This is not new at all. Finding average has been done many times, this is literally just adding a "take every nth element" which has also been done.
i.e This is duplicate of these two katas combined:
https://www.codewars.com/kata/every-nth-array-element-basic
https://www.codewars.com/kata/calculate-average
Even if the array elements are integers, because the final result is a float comparing equality directly will break because of floating point errors.
For example, if someone adds up the integers after dividing by the length, the result will be different.
Random tests are vulnerable to input modification.