May be need to review for random test in C language.
Each time when I test it, the expected value is less than one or two from the actual value. May be the test rounds a number down side but instructions want to round nearest whole number.
I think I fixed it?
The test cases are broken in clojure.
They are written as
(is 0 (average ))
whereas they should be
(is (= 0 (average )))
Submitted my solution before I'd finished, but somehow still passed... Using Clojure.
They use loops internally.
Thank you for answer, I'm clear now :)
Create a function that returns the average of an array of numbers ("scores"), rounded to the nearest whole number. You are not allowed to use any loops (including for, for/in, while, and do/while loops).
That's how round works in Python 3 read here
Tere may a bug in testcase, like:
Testing for [2, 452, 5, 8, 92, 46, 3, 68]
It should work for random inputs too: 85 should equal 84
the sum of [2, 452, 5, 8, 92, 46, 3, 69] equal to 676, and the average is 84.5.
I'm not using any loops, but the error checker is still returning "Solution does not use any loops - Expected: true, instead got: false"
Something weird happened. My first "solution" was simply returning 0 when empty, and 1 when not empty. Somehow it passed all the tests, I attempted the solution and it passed all the tests too. I'm using Clojure.
My solution with parameter "arr" just passed.
If you're still stuck, post your code (put a line of three backticks ``` before and after) and mark it as "having spoiler content".