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.
Yes. Error was due to my test for an empty array not working. Sorry for wasting your time, (I now need to find out why the test didn't work).
I don't know why myself and bhaviksheth were unable to view the results of the basic test or log the inputs.
This comment is hidden because it contains spoiler information about the solution
I'm getting the same result as bhaviksheth. (60 passed and one error).
I'm also unable to expand the basics tests (where the error is) and I receive the following message at the bottom of the output screen.
My code handles the empty array case.
Thanks for creating the Kata.
Minor error in Kata description (possibly).
Description says:
and then lists four types of input. I've just realised that I'm a pedant.
@djdenton Apparently, I disabled the random tests one year ago and only noticed now. Now there will be fractional values for
n
.This is strange.
Math.log1p
should be disabled.Sorry for the late reply and the overly terse initial comment.
From memory I think I spent some time working out how to solve the problem for fractional values of n and was annoyed (mostly with myself) when the tests only use integer values of n. I just ran the tests again and got the same behaviour.
I assumed that the description just needed a tweak to save people like me from ourselves, but maybe there is something wrong with the tests if you never intended n to be integral?
Some of the solutions use Math.log1p and Math.expm1, which is clever, but probably not what you intended.
I really enjoyed these problems so thanks for writing them.
Why? If there are issues with the few left over
Math
methods (abs
,max
,random
and some others), state them. Otherwise this is just a suggestion.That's strange. The
n
in the random tests shouldn't be integral:Either way,
n
was never meant to be integral.Disable the maths library completely and make it clear that the values of nth in the tests will all be integers.
I slightly modified the description in your way but I can't make that everybody takes good care of the description:-) Thanks for your post.
I did kick myself after reading through the question again. :-)
Because it is a real world problem and in the real world you would solve so that
n choose x >= m
it might be worth tweaking the description to help people like me who don't read the question properly.to something like:
Maybe you are right but it is explicitely said:
which is an equation and not an inequation as far as I know:-) I think that the example with 35 posters and 7 colors enlightens that.
This comment is hidden because it contains spoiler information about the solution
Really elegant
Good point. It seems the tests are locked now, unfortunately.
Loading more items...