title: Double Factorial 1
signature: fun doubleFactorial1(n: Int): Long {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Long, expected:Long):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Long):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(24, 1961990553600)
      println("TEST-0...${result}")
      
      result = driver(3, 3)
      println("TEST-1...${result}")
      
      result = driver(22, 81749606400)
      println("TEST-2...${result}")
      
      result = driver(2, 2)
      println("TEST-3...${result}")
      
      result = driver(30, 42849873690624000)
      println("TEST-4...${result}")
      
      result = driver(2, 2)
      println("TEST-5...${result}")
      
          
  }
  
  main()
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;
    }
  }