Ad
  • Custom User Avatar

    you should initialize the result like this result := make([]int, 0)

  • Custom User Avatar

    Better to simplify first: lcm will be smaller.

  • Custom User Avatar

    Hey @enricodallastella - no worries! I see now better what is happening - I was confused also, when I tried those tests using my Python solution. I'm guessing that your Go code is returning this solution:

    [[36156, 68120], [4524, 68120], [51090, 68120]] ? This is what my old Python solution produces also.

    The reason for the confusion seems to be what is stated in the Note section of the kata description: "Newer translations have some reducible fractions. To be on the safe side it is better to do a bit more work by simplifying fractions even if they don't have to be."

    So in the example that is causing problems, once you have obtained the above result, you may have to perform 1 more simplification step: here for example you can see that the numerators and denominator that you get are all divisible by 2, so you can divide all the terms in the fractions - that is where the final value 34060 is coming from.

  • Custom User Avatar

    Sorry, no errors in the tsts.

  • Custom User Avatar

    Hey @enricodallastella - which language are you working in? There are dozens available.

    In fact, can you copy-paste the specific test that you think is wrong - it's much clearer to report bugs if you actually provide the direct evidence, because now people have to guess which one you are referring to, and what the problem may or may not be etc etc.

    Here's an example of how a useful Issue report might look like:

    "In {programming language X} there is a Fixed Test with input:

    a = [[11, 111], [515, 555], [11135, 1151]]

    which expects correct answer

    b = [[2134, 84], [21358, 8554], [17, 8134]]

    but I think this is incorrect because of {justified explanation}"

    edit to avoid confusion: the above a and b are random numbers, not correct values for this kata.