title: Horners Method Polynomial Evaluation
signature: hornersMethodPolynomialEvaluation :: [Integer] -> Integer -> Integer -> Integer
  hornersMethodPolynomialEvaluation poly n x = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: [Integer] -> Integer -> Integer -> Integer -> String
  driver poly n x expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME poly n x) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ([0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1]) (10) (8) (73) )
  
      printf "TEST-1...%s\n" (driver ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) (20) (23) (292561) )
  
      printf "TEST-2...%s\n" (driver ([86, 62, 30, 27, 98, 75, 93, 37, 70, 16, 20, 74, 46, 74, 25, 59, 86, 32, 17, 90, 80, 10, 17]) (12) (12) (67907758875578) )
  
source_py: def horners_method_polynomial_evaluation(poly, n, x):
      result = poly[0]
      for i in range(1, n):
          result = ((result * x) + poly[i])
      return result
source_cpp: int horners_method_polynomial_evaluation(vector<int> poly, int n, int x) {
    int result = poly [ 0 ];
    for ( int i = 1;
    i < n;
    i ++ ) result = result * x + poly [ i ];
    return result;
  }