Hi! An error is issued:
poly = 3a+b+4ac+bc-ab+3a-cb-a-a
Sorry :( : 'b+4a-ab+4ac' should equal '4a+b-ab+4ac'
by the condition of the problem, this is true! 'b+4a-ab+4ac'
poly = -8fk+5kv-4yk+7kf-qk+yqv-3vqy+4ky+4kf+yvqkf
Sorry :( : '-kq+3fk+5kv-2qvy+fkqvy' should equal '3fk-kq+5kv-2qvy+fkqvy'
by the condition of the problem, this is true! '-kq+3fk+5kv-2qvy+fkqvy'
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.
doesn't "5ab" have a number of variables greater than "-c"?
Maybe you're misunderstanding the instructions. Each letter is a variable, you must sort by the "number of variables", not by the coefficient
duplicate of this issue
duplicate of this issue
Solved the problem. The question arose due to a misunderstanding. Clear question == clear answer.
You haven't implemented this case:
In the first example,
4a
should come first beforeb
sincea
<b
in lexicographical order. Same with the second example,fk
<kq
.Hi! An error is issued:
poly = 3a+b+4ac+bc-ab+3a-cb-a-a
Sorry :( : 'b+4a-ab+4ac' should equal '4a+b-ab+4ac'
by the condition of the problem, this is true! 'b+4a-ab+4ac'
poly = -8fk+5kv-4yk+7kf-qk+yqv-3vqy+4ky+4kf+yvqkf
Sorry :( : '-kq+3fk+5kv-2qvy+fkqvy' should equal '3fk-kq+5kv-2qvy+fkqvy'
by the condition of the problem, this is true! '-kq+3fk+5kv-2qvy+fkqvy'
Fix it or test it or tell me where I'm wrong.
Enabled in this fork
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
fork
Python fork (author gone)
ππ
Thank you for this kata! Nice! I've been solving for a long time, but i enjoyed it.
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.
I still am struggling to understand thisπ€. Can someone explain it in a dummy way, please?
doesn't "5ab" have a number of variables greater than "-c"?
Maybe you're misunderstanding the instructions. Each letter is a variable, you must sort by the "number of variables", not by the coefficient
low
Loading more items...