All problems
Polynomial Composition Derivative
Problem
For h(x) = f(g(x)) with polynomials f and g, the derivative at x is f'(g(x)) * g'(x).
Given coefficient lists of f and g in ascending order and the point x, return h'(x).
Hint
Evaluate the inner polynomial first, then multiply the two derivatives.
Test cases
case 1
in: [[0,0,1],[1,1],1]
expected: 4
case 2
in: [[1,2],[0,3],2]
expected: 6
case 3
in: [[0,1],[2,-1],0]
expected: -1
Starter codePython
def polynomial_composition_derivative(f, g, x):
# Your code here
pass3 test cases · run your code against them in the editor