Ad
  • Custom User Avatar

    I agree, but this is not an issue, rather a suggestion. Anyway, changing it would invalidate 60+ solutions, so it stays as is.

  • Custom User Avatar

    Good catch! Fixed.
    Thanks!

  • Custom User Avatar

    Interesting: anybody cares to give me more details?

  • Custom User Avatar

    @GiacomoSorbi - one for you

  • Custom User Avatar

    I felt the same the first time I solved a problem requiring to compute the LCM of a list of numbers; well, it still means that you are learning, so is not so bad in the end ;)

  • Custom User Avatar

    Any further suggestion will be welcome!

  • Custom User Avatar

    Thanks for your observation. Now it's says as you pointed out decomposition of a number. Fixed! Thanks also for your solutions in Python. One of them upvoted. (+1)

  • Default User Avatar

    Modifications done. Lots of thanks for your posts!

  • Default User Avatar

    I know that this kata is a bit problematic...

    1.Change the description and ask to return the nth tailor series expansion, where the numerator is at least "digit" digits long. Or change the test cases so that they expect the numerator is exactly "digit" digits long.

    The description already says:
    The function expand will return an array of the form [numerator, denominator]; we stop the loop when numerator has a number of digits >= the required number of digits.
    and
    the way is to use Taylor expansion of the exponential function...

    Are you sure that the digitth series expansion gives at least "digit" digits?
    How to change the test cases so that they expect the numerator is exactly "digit" digits long? In some cases the Taylor expansion gives "digits + 1".
    Maybe I could say:
    "The function expand will return an array of the form [numerator, denominator]; we stop the Taylor expansion when numerator has a number of digits >= the required number of digits". What do you think of that sentence?

    2.Explicitly allow x to be a float in the description, otherwise people will, imho correctly, assume x to be an integer. Or exclude the test cases where x is not an integer.

    Usually in exp(x) x is a real so an int or a float. Nevertheless I will add in the description an example where x is a float.

  • Custom User Avatar

    Hi finsternacht. Thanks for your feedback. The tests were prepared for efficient brute force algorithms. You gave a good idea in the possibility of further challenges related with probability. If you publish one, I'll be there to try to solve it. I haven´t seen your solution yet. :)

  • Default User Avatar