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.
"Focus on efficiency" at the end of kata description is the hint what you shoud do.
You'll have to optimize your code...
"Process was terminated. It took longer than 12000ms to complete" doesn't always mean that all tests were passed; nevertheless refactoring your code might be useful.
That's part of the definition of what the median is: it's the middle value of a sorted data set.
You cannot determine a mean without sorting the array.
But it is good practice to sort a copy of the input array, so you don't change the input array itself.
Most people don't bother with that precaution in this kata (I didn't), and the tests are unaffected. (Yes, this means the tests are designed better than most solutions.)
mean = (-10 + 20 + 5) / 3 = 5
median = {-10, 5, 20}[1] = 5
result = same
Median is 5. (You have to sort the values.)
Mean is 5.
Does this answer your question?