6 kyu
Compact polynomial
37 of 67Glushatov
Loading description...
Fundamentals
Puzzles
Mathematics
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.
It was a wonderful math puzzle. Thank you
Description was not clear for me. I would suggest to change it to
Currently it sounds like real and complex roots are ok.
I don't get it, the current description already states "integer roots"
I read it as "no (repeating or zero integer roots)". Also "zero integer roots" reads like "it should have at least one integer root".
oh I see, is it ok now?
Yes, it is more clear for me now.
Guys, I thought I understood the problem well and found the proper solution to it. (JS) At that, while my solution always passes complete set of "small" random tests, it fails the 1st "big" test. Can there be something wrong with JS "big" tests or I am really so stupid on Friday morning :) ...
Try not to use floating point arithmetic.
This comment has been hidden.
I will lower the range to 32 bit in JS.
I made a fork for the Python test cases.
Small
,Medium
andBig
for both fixed and random tests.1000
to150
,1000
felt like it was too much.failed on test 324
. I didn't see a good reason for it, especially with fewer tests.Any of these changes can be reverted, so be sure to let me know if you disagree with any of them.
done
JavaScript: either
BigInt
should be used or the input upper bound should be lowered in random tests.upper bound lowered
In C++, proper utilities from
<random>
should be used to generate large random numbers.What is a pairwise distinct integer non-zero root?
To have
n
pairwise distinct integer non-zero roots, means to haven
roots with no repetition amongst themselves, also none of them can be zero.I feel like that part could have been worded better...
Hey, I have very mixed feelings about his one, but I do ultimately like it. It does give you a nice feeling when you complete it.
There are a few minor spelling mistakes in the description, such as have instead of has and maxinal instead of maximal. I'm more than willing to fix them myself; I believe I can edit it directly while it's in beta, but I'm not sure if a fork would be better.
I'd be glad if the creator or moderator contacted me so we could proceed.
Hopefully I don't sound too pedantic. I know it's not a big deal, but I think it's nice to fix it.
you can fork and fix yourself
How do I fork it? I only see the option to directly edit it.
mmhm, maybe it doesn't work in beta; you can edit directly, but you probably won't get any ranking points on approval for this kata
I don't care much for the points, that's no problem.
I've edited it, if you could please check and see what you think, I'd be grateful.
Thanks to your feedback I was finally able to understand the task and managed to solve it.
btw, I'm able to fork. Maybe because I am a mender. Are you sure you don't see a "fork" button?
Well, I'm glad I was able to help you in some capacity to solve it.
On the fork thing, it might be because I'm on my phone. I'm also in the middle of a linear algebra class, so I haven't been able to look for it very well, lol. I'll take a better look when I'm home on my computer.
C++ translation has severe code style issues and could use serious overhaul:
Assert::That(a == b, Equals(true))
could be justAssert::That(a, Equals(b))
ExtraMessage
to present inputs,<random>
should be used to generate large random numbers.two_oldest_ages_test
placeholder name.Additionally in C, the failure message should be something better than just an
"incorrect answer"
(duh!).Since this is a puzzle, I'm not sure the error feedback should be improved though.
I haven't solved the kata so I guess you know better. Just by reading the description, the task makes an impression of a clearly explained, math oriented problem, and I do not see what's so puzzling about it, but I can be just missing something.
Because when you see the ins and specially outs of the problem, you may or may not see a pattern emerging. The purpose of this kata is to solve it the mathematical way, without using pattern matching skills.
fixed the test name; remaining issue reposted as suggestion
I'd say that the testing and error messages could use some work. However, there's only so much feedback that can be provided without spoiling the kata.
Feel free to suggest changes or a fork. Just make sure to keep test output a black box.
I published a fork, but please review it, there are a few changes I'm not too sure about. And yes, I couldn't make a fork because I was on my phone.
This comment has been hidden.
This comment has been hidden.
long long
is used in C++, but the description saysunsigned long long
.Fixed, thank you!
This comment has been hidden.
This comment has been hidden.
Do not redefine
print
in Python: There should be no restrictions on printing input values.Fixed, thank you.
Preloaded should not be used for
include
andusing
directives..
The output type should be a tuple.
.