Use map
to evaluate a given polynomial at a specific x-value.
Input:
- p: A list of coefficients for increasing powers of x
- x: The value of x to evaluate
Output: Number representing the value of the evaluated polynomial
Example: poly_eval([1, 2, 3], 2) = 1(2)^0 + 2(2)^1 + 3(2)^2 = 17