All problems
Power Rule Derivative Coefficients
Problem
Differentiate a polynomial given its coefficients in ascending order: if f(x) = sum_i coeffs[i] * x^i then f'(x) = sum_i (i * coeffs[i]) * x^(i-1).
Return the derivative coefficients in ascending order, dropping the constant term.
Hint
Index i becomes the multiplier and the degree drops by one.
Test cases
case 1
in: [[1,2,3]]
expected: [2,6]
case 2
in: [[5]]
expected: []
case 3
in: [[0,0,0,4]]
expected: [0,0,12]
Starter codePython
def power_rule_derivative_coeffs(coeffs):
# Your code here
pass3 test cases · run your code against them in the editor