title: Horners Method Polynomial Evaluation
signature: horners_method_polynomial_evaluation <- function(poly, n, x) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(poly, n, x, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(poly, n, x), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L), 10L, 8L, 
          73L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 20L, 23L, 
          292561L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(86L, 62L, 30L, 27L, 98L, 75L, 93L, 37L, 70L, 16L, 20L, 74L, 46L, 74L, 25L, 59L, 86L, 32L, 17L, 90L, 80L, 10L, 17L), 12L, 12L, 
          67907758875578L
      )))
  
  }
  
  main()
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;
  }