Naive Approach # Time complexity: O(n^2) def evaluate(poly, x): result = 0 for i in range(len(poly)): result += poly[i] * (x ** i) return result Horner’s Method a0+a1x+⋯+anxn=a0+x(a1+x(a2+x(a3+⋯+x(an−1+xan)⋯) # Time complexity: O(n) def evaluate(poly, x): result = poly[len(poly) - 1] # Loop for i in range(len(poly) - 2, -1, -1): result = result * x + poly[i] return result