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.
In C variant I was still getting even-length arrays, so I decided to handle that and compute median as it should be computed -- mean of 2 middle elements.
So I spent few hours after that trying to figure out error, then I decided to handle even-length arrays as odd-length, and all tests passed.
You should either fix description and tests, or just fix tests to generate only odd-length arrays.
The most simple thing you should do is add
while
loop inint getRandomInteger(int lowerBoundInclusive, int upperBoundExclusive)
, checking for even value.P.S. Didn't mark this as spoiler since kata for C is broken and people can actually spend quite a lot time figuring out problem that doesn't exist.