Your question is Polynomial Equivalence Function. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Blend's decision logic can represent algebraic calculations as sparse polynomials. Given two polynomials, determine whether they represent the same mathematical function after combining terms with equal exponents.
Each polynomial is provided as a list of terms, where every term is [coefficient, exponent] and represents coefficient * x^exponent. Terms may appear in any order, multiple terms may have the same exponent, and zero-coefficient terms may be included.
Return True if the polynomials are equivalent for every value of x; otherwise, return False.
Implement are_equivalent(poly1, poly2).
poly1 and poly2.x values.def are_equivalent(poly1, poly2):