GO Solution For UVa 10326 - The Polynomial Equation. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

A Polynomial equation of degree n is defined as follows :

C0 +

nāˆ‘ i=1

(Ci āˆ— xi) = 0.

A polynomial equation of n degree can have at most n distinct roots which may be both real or complex. Such as a quadratic equation :

x2 āˆ’ 5x+ 6 = 0

has two roots 2 and 3. In this problem you have to generate

...

You can find the full details of the problem The Polynomial Equation at UVa Online Judge

Sample Input

2
2 3
2
-2 -3
3
0 1 -1

Sample Output

x^2 - 5x + 6 = 0
x^2 + 5x + 6 = 0
x^3 - x + 0 = 0

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985