4 kyu
Differentiate a polynomial
822 of 3,008samhstn
Description:
Create a function that differentiates a polynomial for a given value of x
.
Your function will receive 2 arguments: a polynomial as a string, and a point to evaluate the equation as an integer.
Assumptions:
- There will be a coefficient near each
x
, unless the coefficient equals1
or-1
. - There will be an exponent near each
x
, unless the exponent equals0
or1
. - All exponents will be greater or equal to zero
Examples:
differenatiate("12x+2", 3) ==> returns 12
differenatiate("x^2+3x+2", 3) ==> returns 9
Algorithms
Strings
Fundamentals
Similar Kata:
Stats:
Created | Dec 7, 2015 |
Published | Dec 7, 2015 |
Warriors Trained | 13591 |
Total Skips | 5262 |
Total Code Submissions | 31766 |
Total Times Completed | 3008 |
JavaScript Completions | 822 |
Python Completions | 1779 |
Ruby Completions | 107 |
Java Completions | 333 |
Total Stars | 438 |
% of votes with a positive feedback rating | 95% of 530 |
Total "Very Satisfied" Votes | 482 |
Total "Somewhat Satisfied" Votes | 43 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 4 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 5 kyu |