Simplifica la expresión.
(POLYNOMIALS[0]) SIGNS[0]
(POLYNOMIALS[1]
POLYNOMIALS[1].multiply(-1))
SIGNS[1]
(POLYNOMIALS[2]
POLYNOMIALS[2].multiply(-1))
SOLUTION.parsableText()
Distribuye los signos negativos.
(POLYNOMIALS[0]) + (POLYNOMIALS[1]) + (POLYNOMIALS[2])
Dado que estamos sumando polinomios, simplemente podemos eliminar los paréntesis.
POLYNOMIALS[0] + POLYNOMIALS[1] + POLYNOMIALS[2]
Identifica los términos similares.
(POL.coefs[index] < 0) ? "-" : (n === 0 && POL === POLYNOMIALS[0]) ? "" : "+"
\color{COLORS[ n ]}{abs(POL.coefs[index]) === 1 ? "" : abs(POL.coefs[index])
X^index}
Combina términos similares.
+ \color{COLORS[index1]}{
coeff[0]
(
+
TERM
)
X^SORTED_INDICES[index1]}
Suma los coeficientes.
SOLUTION