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

    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 and make it clear that the values of nth in the tests will all be integers.

  • 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

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

  • Custom User Avatar
  • Custom User Avatar

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