← Questions

Simplify a quadratic expression

0
OpenAICodingLast asked Oct 2026

You get a string such as 5x+7x^2+4+x^2-24x: a sum of terms in any order, each a constant, a multiple of x or a multiple of x^2, with optional signs and coefficients. Combine like terms and return the three coefficients [a, b, c] of ax^2 + bx + c. For the example the answer is [8, -19, 4]. Watch for terms with no written coefficient (x, -x^2).

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding