Ad
  • Default User Avatar

    Thank you for pointing this out. Test and solution codes have been updated.

  • Custom User Avatar

    Needs edge case with b = 0.

  • Custom User Avatar

    Okay, in fact after looking at the author solution it's an understatement to say that it's completely wrong. What it (and the description) shows is kata author lacks the basic understanding of fundamental algebra and equation solving.

    Please study some basic mathematics and understand what the you've linked to is actually about. Cubic polynomials aren't solved this way, and it's not relevant to the task at hand.

  • Custom User Avatar
    18x^3-50x^2+14x+28
    ... should equal [1, 2]
    

    The reference solution is wrong too; the cubic equation 18x^3-50x^2+14x+28=0 has 3 roots: -0.57, 1.35 and 2.

    Also, why is every test expecting integers besides one specific fixed test?

  • Custom User Avatar
    test.assert_equals(solve('x^3-7'),None)
    

    This fixed test is wrong since 7**(1/3) is a root. In fact, None is impossible since every cubic polynomial must have at least 1 real root.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution