Ad
  • Default User Avatar
  • Default User Avatar
  • Default User Avatar

    "...the idea is to substitute the examples into the formula and reduce the resulting equation to one unique term. ...Using this pattern, only one solution is possible for each test..."

    But hold on! The uniqueness of solution is disapproved by the example in the description itslef: [ "a + a = b", "b - d = c ", "a + b = d" ]. The expected answer is '2a', however '1b' (or just 'b' - what a strange requirement for explicit 1!) is also a correct answer and it is simpler than the expected one!

    Need to revise the kata for either accepting all possible single-term answers (the preferred approach), or making the rules more specific.

  • Default User Avatar

    The asked output is not mentioned and the "Should become:" is misleading.

  • Custom User Avatar

    This kata should really be sent to beta: there are a fuck ton of hidden assumptions on the input data that allows very specific, underhanded solutions:

    1. RHS of every example is always a single variable term with no coefficients
    2. Substitution is assumed to be rewriting each example's RHS to LHS, so there will be no cases like examples = ["a + b = c"], equation = "a + b"
    3. Substitution rules are always unambiguous, and strictly in one direction (aka no things like ["a = c", "b = c"], ["a = a"] or ["a = b", "b = a"])
    4. The terms are always formatted in a way that subsitution can be done with string manipulation only
    5. Substitution will always give a single term as answer
    6. The last term will always be either "the first variable appearing in the list of equations that, when expressed as the result, has an integer coefficient", or "the only one term after finishing RHS to LHS rewrite", probably because of how all the test data, including fixed tests, are generated

    The specificality of these assumptions make this kata a completely different one from what it is trying to imply (something very generic). It's asking us to apply 5kyu cheese algorithm to a generic 2kyu problem. This is utterly unacceptable.

  • Custom User Avatar

    It is still not clarified in the kata description which variable to choose to return the result. B4B didn't actually do anything correct before resolving all the issues and approving this ;-(

    (Also, no, adding puzzle tag is not an excuse/workaround for such dubious kata design. That's just lame.)

  • Custom User Avatar

    You don't explain what POSITIONS and LENGTHS are.

  • Custom User Avatar

    I have problems understanding the instruction: "POSITIONS... and LENGTHS... are comma-separated lists."
    Do I have to write a seperate class "Branch"? What do you mean with comma-seperated list?
    can u explain it a bit more detailed pls?

  • Custom User Avatar

    There's no point of having 10k random tests for this kata.

  • Custom User Avatar

    I passed 10,000 random tests with this wrong solution(without using anything of buffer)

  • Default User Avatar

    The expectations on this one were baffling, as the description was poorly written and left out several important things that would actually be tested.

    I think it should have had better sample tests, clearer descriptions of which variable needs to be returned, and actually stated things that might not necessarily be obvious, like how all coefficients will be integers, that variables could be both uppercase and lowercase letters, and that formula might have only one variable.

    I solved it, but I hate it.

  • Custom User Avatar

    Ruby translation

    Please review and approve.

    Note: eval has been disabled in this version.

  • Custom User Avatar

    Considering the rank of the kata, I'm thinking about forbidding eval in python (replacing the original solution of the author with mine if needed).

    Opinions? (from the author ofc, but others too?)

    EDIT: and java too... x/