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.
On Haskell there is a bug in testing code:
In random tests, for example, having a list of monomials: ("", -1), ("b", -9), <...>
so, the system says:
expected: "--9b+ <...>"
got: "-9b <...>"
Obviously, that testing code doesn't work correct for monomial "-1", because, it reduces that to "-" (like "-1a" should be reduced to "-a")
So, could you please, check this behaviour and fix it?
Regards
Python fork (author gone)
How do I understand which tests were used in the section "More complicated tests"? Otherwise I won't understand how to fix the code. All other tests are solved correctly.
In Haskell the test logs should provide the input, at least in case of fails.
Random tests in Haskell sometimes generate cases with constants:
[("abcy",-14),("",-8),("axyz",-9),("bcdz",-3)]
,or with coefficients equal to zero:
[("abz",15),("abcx",10),("adx",-6),("abcdxyz",9),("axz",0),("abc",3)]
.It makes the task more fun, but it contradicts the rules laid down in the description:
I'd suggest either changing the description or fixing random tests.
Ruby 3.0 should be enabled.
This comment is hidden because it contains spoiler information about the solution
One of the python test cases starts with a +, which seems to go against the rules that any leading + on a polynomial will be hidden.
Bugs in random tests for Haskell:
sometimes expected value starts with "--.....", which is clearly wrong.
PHP random tests seem to be off as well.
For: -12dy+9yzd-9dyz-13y+8y-1-11yd+15yd+9y
it expects: 4y-8dy-10dyz
The "1" term should not be there according to the description and the test result makes no sense as a result.
Still some bugs in the random tests of the Haskell version.
eg 1) expected: "-+14c+11x... due to a ("",-1) term
eg 2) expected: "z-6ab-9ac... but there was an (uncancelled) ("",1) term present.
Happily, random test cases are random, so two presses later I had clean green.
Ruby:
Random Tests return incorrect expected values:
one example:
Testing for +7dy+12d-14d
✘ It should work for random inputs too - Expected: "26d+7dy", instead got: "-2d+7dy"
I don't understand why the result should be 'x-y'
In the description, it says that there is no restriction for '-' sign.
The error I'm facing is:
'-y+x' should equal 'x-y'
I spent A LOT of time on your kata, even after I solved it... ;-)
I made a version which can handle coefficients without variables, coefficients greater than 10 and variables with exponents (syntaxes allowed : ** or ^ ; but exponents have to be positives and written without brackets).
It might be interresting to confront it with others answers. Would like to create a harder version of the kata ?
It could be interesting to link those two (like SteffenVogel_79 did with his encryption problems : https://www.codewars.com/kata/57814d79a56c88e3e0000786 )
Thanks for this problem !
Well, me again...
While checking my code to improve it, I discovered it is actually wrong ! But it passes the tests all the same !
I suggest you implement some tests with coefficients bigger than 10 (in the previous version of my code, I inverted the strings so 31 becomes 13...)
Loading more items...