Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
None of the issues on the list are fixed.
This comment is hidden because it contains spoiler information about the solution
This is not specified.
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.
As I mentioned below, maybe you are forgetting something.
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
.Missing fixed test in the actual test suite.
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.)
Should add more test with smaller values
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:This kata lacks originality overall
I told you everything I know.
As mentioned below, the kata as specified right now is unsolvable, as the equation is under-determined.
12345 * 67890 + 54321
is equal to12344 * 67890 + 122211
, or0 * 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.
a*x+y=b
defines a line ( infinite in both directions ). "a
is always bigger thanx
andy
" 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?
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!
Maybe you are forgetting something
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.Perhaps
I did add a statement to return an array
[x, y]
in the descriptionLoading more items...