Tests do not necessarily test for "-1" being the coefficient of the term with the highest power of the variable (e.g. the x^3 coefficient of (-x+1)^3 is -1). In this case, my original code would have returned -1x^3 + ..., yet it passed because this case was not tested (I ran it again because I removed some print() statements, and then it failed).
Brilliant kata, though—thanks!
Since Python 3.9, typing aliases like Tuple, List, or Set are deprecated because the type themselves (tuple, list, set ...) now directly support the [] operator. The type hints in the initial code should be rewritten in consequence
(Python) Apparently the test for specification "If the coefficient of a term is zero, the term should not be included" is not being performed. My first solution did not handle these cases and I passed every test.
Ouput for expand("(r+0)^203") given by my first solution:
Normally this would be a suggestion, but in this case I think it warrants an issue:
all of the coordinates that contain the given value and are connected to the original coordinate by the given value.
I had the hardest time understanding what "connected by the given value" means, until someone explained to me it means "adjacent". The fact that it is already stated that the coordinates shall contain the given value led me to believe that "connected ... by the given value" meant some special definition of "connected". It doesn't, it's just a redundant expression.
Can the description please be modified to state something like:
"... of all the coordinates that contain the given value and are connected to the original coordinate via adjacency/moore neighbourhood..."
Also, though not related: this is pretty much just a duplicate of any of multitude of path finding kata.
java: sample and full tests produce warnings
I also have to question this one, I won't assert that it is definitely wrong but I suspect it is:
Tests do not necessarily test for "-1" being the coefficient of the term with the highest power of the variable (e.g. the x^3 coefficient of (-x+1)^3 is -1). In this case, my original code would have returned -1x^3 + ..., yet it passed because this case was not tested (I ran it again because I removed some
print()
statements, and then it failed).Brilliant kata, though—thanks!
Rust sample tests expect the function to be named
expand_binomial
, but the initial code and the full set of tests expectexpand
.Since Python 3.9, typing aliases like
Tuple
,List
, orSet
are deprecated because the type themselves (tuple
,list
,set
...) now directly support the[]
operator. The type hints in the initial code should be rewritten in consequence(Python) Apparently the test for specification "If the coefficient of a term is zero, the term should not be included" is not being performed. My first solution did not handle these cases and I passed every test.
Ouput for
expand("(r+0)^203")
given by my first solution:Go translation
D translation
Normally this would be a suggestion, but in this case I think it warrants an issue:
I had the hardest time understanding what "connected by the given value" means, until someone explained to me it means "adjacent". The fact that it is already stated that the coordinates shall contain the given value led me to believe that "connected ... by the given value" meant some special definition of "connected". It doesn't, it's just a redundant expression.
Can the description please be modified to state something like:
Also, though not related: this is pretty much just a duplicate of any of multitude of path finding kata.
COBOL translation (author is inactive).
This comment is hidden because it contains spoiler information about the solution
Good kata!
Still, I'd prefer to see example with -x and big numbers in initial unit tests.
For example:
CoffeeScript translation kumited
please scrutinize for approval.
Natural numbers normally don't include 0...
You should add random test cases. In its current state, it can be hardcoded: https://www.codewars.com/kata/reviews/5404b3f39f21e1b6f500012d/groups/5e51f1c077d51a000155e69c
This comment is hidden because it contains spoiler information about the solution
Loading more items...