Ad
  • Custom User Avatar

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

  • Custom User Avatar

    ah ok, thanks a lot

  • Default User Avatar

    Better to simplify first: lcm will be smaller.

  • Default 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.

  • Default User Avatar

    Sorry, no errors in the tsts.

  • Custom User Avatar

    Ah sorry, this is ,my first time commenting...
    I'm running my program in GO.
    the fixed imput is:
    {69, 130}, {87, 1310}, {30, 40}
    and is expected the output to be equal:
    (18078,34060)(2262,34060)(25545,34060)
    but if you actually calculate the lcm should be 68120, infact if you divide 34060 by 40 it return that 34060 is not a multiple of 40 and so i believe the test isn't correct.

  • Default 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.

  • Custom User Avatar

    Basic tests are wrong. it says that 34060 is a multiple of 40 and it is not...

  • Custom User Avatar

    Is it just me or the empty matrix solution in GO give some problem?