Beta
Polynomial from Points
12Trouv
Loading description...
Mathematics
Linear Algebra
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Python 3.8 should be enabled.
Fixed
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 isx^4+2x^2+3x+4
).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.
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.
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.
This comment has been hidden.
This comment has been hidden.
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
Duplicate to Linear Equation Solver
Is this really similar enough?
Ofc not 'similar', this kata is, a Subset of that And why you spoiler it?
This comment has been hidden.
This comment has been hidden.
I went ahead and shrunk the big tests so that they're still a little bigger than they were originally. I think I'll go ahead and mark this as resolved unless I get a 3rd opinion saying it is a duplicate.
test.assert_equals
. Using expect is the thing you do only wahen that's the only option.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
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
no you have to use the correct stuff. You're on CW's gitter channel?
(note: I suggest you unpublish the kata in the meantime)
ok I think I fixed it