title: Double Factorial 1
signature: func doubleFactorial1(n int) int64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int64, expected int64) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(24, 1961990553600)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(3, 3)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(22, 81749606400)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(2, 2)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(30, 42849873690624000)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(2, 2)
      fmt.Printf("TEST-5...%s\n", result)
      
          
  }
source_py: def double_factorial_1(n):
      res = 1
      for i in range(n, (- 1), (- 2)):
          if ((i == 0) or (i == 1)):
              return res
          else:
              res *= i
source_cpp: unsigned int double_factorial_1(unsigned int n) {
    int res = 1;
    for ( int i = n;
    i >= 0;
    i = i - 2 ) {
      if ( i == 0 || i == 1 ) return res;
      else res *= i;
    }
  }