7 kyu
Total Sums of Coefficients of a Binomial Raised to the Nth-Power
287 of 378raulbc777
Loading description...
Fundamentals
Data Structures
Algorithms
Mathematics
Logic
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's impossible to return the results in C because they are bigger than the output type.
thank you
Translation has been corrected for
And there's input range in the description that doesn't match the tests.
Nota Bene added to description for specification clarity
This appears to have NOT been resolved. For n = 63, there an overflow even with the C unsigned long long type. For that series, the last two numbers overflow:
I recommend stopped at n = 62 (this would also correct the bogus range of the "High Performance" tests to not exceed UCHAR_MAX).
C Translation
Python new test framework should be used
Ruby 3.0 should be enabled
Ruby 3.0 enabled in this fork, Python already done, resolving this.
Description should be language-agnostic
This part is clearly unclear
We need a function that may generate an array with the values of all the coefficients sums from 0 to the value of n included and has the addition of all the sum values as last element.
x^(n-2)y^0
should bex^(n-2)y^2
C Translation rectifies these issues.
Approved
We need a function that may generate an array with the values of all the coefficients sums from 0 to the value of n included and has the addition of all the sum values as last element.
it could be helpful if there was an explantions to the example f(0) = [1, 1] f(1) = [1, 2, 3] f(2) = [1, 2, 4, 7] f(3) = [1, 2, 4, 8, 15] why 7? why f(3) = [1, 2, 4, 8, 15]?
The last number is the sum of the previous elements in list.
1+2+4!=8 1+2!=4
You were asking why 7? Because 1+2+4=7 The last element is the sum of the coefficients, which are the previous elements in list.
To give more details (it is true the description is not super clear... but have a look at the table in it with the four first degrees equations development):
Haskell : https://www.codewars.com/kumite/5bbbc55c2d15ec4d870002de?sel=5bbbc55c2d15ec4d870002de
Hi Cliff. I'll approve it when I come back home in 4 hours. I PM you on Gitter about the previous translation.
This comment has been hidden.
This comment has been hidden.