Beta

Polynomial from Points

Description
Loading description...
Mathematics
Linear Algebra
Algorithms
  • Please sign in or sign up to leave a comment.
  • FArekkusu Avatar

    Python 3.8 should be enabled.

  • monadius Avatar

    It is not clear from the description that the empty string should be returned for the zero polynomial. You say that terms with zero coefficients should not be included. But at the same time there is a rule for not displaying 1 which is not enforced for constant terms.

    Also there is a typo in the description: the first example answer should be x^3+2x^2+3x+4 (now it is x^4+2x^2+3x+4).

    • Trouv Avatar

      It makes more sense to return '0', so I specified that it should do that, changed the solution, and added a test case for it. Also fixed the typo.

      Issue marked resolved by Trouv 6 years ago
  • monadius Avatar

    I suggest to increase the maximum degree of tested polynomials up to 30-40. Then it will be much harder to solve this kata with standard methods for solving linear equations. My solution without any special optimizations can handle degrees up to 50.

    • Trouv Avatar

      I had it at 20 earlier and Voile thought it was too high. I guess I'll have to actually develop an opinion lol. I'll also have to look at your solution since mine times out when testing 100 30-point cases.

    • monadius Avatar

      This comment has been hidden.

    • Voile Avatar

      This comment has been hidden.

    • Trouv Avatar

      Perhaps we could have an advanced version of this kata? Idk if a bigger test size is enough justification to make a separate version though

  • ZED.CWT Avatar
  • Blind4Basics Avatar
    • provide the expected value using test.assert_equals. Using expect is the thing you do only wahen that's the only option.
    • you didn't describe the empty input.
    • Trouv Avatar

      I specified that there won't be empty input (and fixed the test cases so there won't be), and changed them all to assert_equals

      Issue marked resolved by Trouv 6 years ago
  • Blind4Basics Avatar

    This comment has been hidden.