Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

    Unhandled rejection TestError: Expected: 'null', instead got: '0'

    My code handles the empty array case.

    Thanks for creating the Kata.

  • Custom User Avatar

    Minor error in Kata description (possibly).

    Description says:

    You can get three types of input:

    and then lists four types of input. I've just realised that I'm a pedant.

  • Custom User Avatar

    @djdenton Apparently, I disabled the random tests one year ago and only noticed now. Now there will be fractional values for n.

  • Custom User Avatar

    Some of the solutions use Math.log1p and Math.expm1, which is clever, but probably not what you intended.

    This is strange. Math.log1p should be disabled.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Disable the maths library completely

    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.

    make it clear that the values of nth in the tests will all be integers.

    That's strange. The n in the random tests shouldn't be integral:

    n = Math.random() * 20 + 0.5;
    

    Either way, n was never meant to be integral.

  • Custom User Avatar

    Disable the maths library completely and make it clear that the values of nth in the tests will all be integers.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

    knowing m (number of posters to design), knowing n (total number of available colors), let us search x (number of colors for each poster so that each poster has its own combination).

    to something like:

    Given the number of posters you need to design (m) and the number of available colors (n) find x: Where x is the number of colors used in each poster such that each poster has a unique combination of colors and the number of combinations is exactly the same as the number of posters (m).
  • Custom User Avatar

    Maybe you are right but it is explicitely said:

    In other words we must find x such as n choose x = m (1) for a given m and a given n...

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    Good point. It seems the tests are locked now, unfortunately.

  • Loading more items...