• Custom User Avatar

    Thanks for this kata.

    I think the test has a serious deficiency: it does not check if the solution contains the smallest possible numbers, although this condition is stated in the problem description. Please modify the test or the description.

  • Custom User Avatar

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

  • Custom User Avatar

    I can't even solve this with pen and paper. Am I stupid or is this a very difficult one?
    Any hints to get started?

  • Custom User Avatar

    My two cents: this would do very well as a performance kata. Maybe push the upper bounds for num up to 50 or so or add many, many, many more tests. Just a thought. Solid kata idea either way.

  • Custom User Avatar
  • Custom User Avatar

    |n/d - π| < eps For eps==0.1, why would 16/5 be wrong?

    16/5 = 3.2 -> |3.2 - 3.14159| = 0.058 < 0.1

  • Custom User Avatar

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

  • Custom User Avatar

    As the current tests goes, there is a serious lack of resolving power and lots of fractions between the input ranges are not tested at all (just look at my solution and ZED's solution).

  • Custom User Avatar

    The random tests does not cover every value of the entire range, so some solutions that fails at some particular values will still pass the tests, given some amount of submits.

    If you don't want duplicates, you can always use a set to hold the values until the size is of a certain size, and then shuffle the result. Asymptotic complexity is just O(n*log(n)).

    Also, 50 tests are not enough, at least 500 or something is recommended for good coverage of the input range.

  • Custom User Avatar

    why the rounding? It has absolutely no point in the task. Use rather the proper assertion and reduce the length of the code allowed.

    I have to admit, though, I'm clearly not fond of the idea (code length).