Ad
  • Custom User Avatar

    None of the issues on the list are fixed.

  • Custom User Avatar

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

  • Custom User Avatar

    Obviously the results should be integers

    This is not specified.

  • Custom User Avatar

    And maybe you're trolling, which certainly can't be excluded from currently available information.

    It would certainly be nice if you said what we're forgetting.

  • Custom User Avatar

    As I mentioned below, maybe you are forgetting something.

  • Custom User Avatar

    Obviously the results should be integers, which the author forgot to mention. This might be enough to guarantee uniqueness, or perhaps x, y >= 0 is also required. Diophantine equations are not my strong suit.

    Can anyone come up with an alternative integer solution to either of the sample tests? EDIT: Your proposed alternative solutions break the constraint y < a.

  • Custom User Avatar
    1. Missing fixed test in the actual test suite.

    2. Should increase the number of random tests, 10 is too few. (Consider increasing the number of random test to 100 to ensure good test coverage.)

    3. Should add more test with smaller values

    4. The current constraints are not enough to ensure a unique solution, either further improve the constraints or accept any valid solution.

      For example:

      If a = 10 and b = 51, the equation a * x + y = b has following multiple valid solutions:

      • 10 * 5 + 1 = 51
      • 10 * 6 + (-9) = 51
      • 10 * 7 + (-19) = 51
      • ...
    5. This kata lacks originality overall

  • Custom User Avatar

    I told you everything I know.

  • Custom User Avatar

    As mentioned below, the kata as specified right now is unsolvable, as the equation is under-determined. 12345 * 67890 + 54321 is equal to 12344 * 67890 + 122211, or 0 * 67890 + 838156371.

    This is not a "you didn't get the gotcha" (not to mention that'd make it a very shitty kata). This is basic algebra. Relearn your maths before resolving the issue.

  • Custom User Avatar

    a*x+y=b defines a line ( infinite in both directions ). "a is always bigger than x and y" defines a quadrant.

    Said line may be outside that quadrant, in which case there are no solutions. Or it may be partially inside that quadrant, in which case there are infinitely many solutions. It says nowhere that numbers are integers, and the line probably goes to plus or minus infinity inside the quadrant.

    Without any other constraints than mentioned in the description, how can you ask for a single solution?

  • Custom User Avatar

    I read the description. I wrote a solution. Please tell me where it's wrong.

    I am quite sure the description is not telling me everything I need to know. There might be something that you think you wrote, but didn't, or are assuming wrongly to be known. But I can't tell you what it is, because I can't read your mind, I can only read the description!

  • Custom User Avatar

    Maybe you are forgetting something

  • Custom User Avatar

    There must be constraints you're not telling.

    You can now see my solution, it's correct according to the specs, but it doesn't pass.

    One equation with two unknowns is not uniquely solvable, and x,y < a is not enough.

  • Custom User Avatar

    Perhaps

  • Custom User Avatar

    I did add a statement to return an array [x, y] in the description

  • Loading more items...