title: Find Last Digit Factorial Divides Factorial B
signature: func findLastDigitFactorialDividesFactorialB(a int, b int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(a int, b int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(a, b),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(79, 
  	84, 0)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(61, 
  	29, 1)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(39, 
  	77, 0)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(39, 
  	65, 0)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(61, 
  	78, 0)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(86, 
  	73, 1)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(7, 
  	92, 0)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(86, 
  	50, 1)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(86, 
  	63, 1)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(11, 
  	2, 1)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def find_last_digit_factorial_divides_factorial_b(A, B):
      variable = 1
      if (A == B):
          return 1
      elif ((B - A) >= 5):
          return 0
      else:
          for i in range((A + 1), (B + 1)):
              variable = ((variable * (i % 10)) % 10)
          return (variable % 10)
source_cpp: int find_last_digit_factorial_divides_factorial_b(long long int A, long long int B) {
    int variable = 1;
    if ( A == B ) return 1;
    else if ( ( B - A ) >= 5 ) return 0;
    else {
      for ( long long int i = A + 1;
      i <= B;
      i ++ ) variable = ( variable * ( i % 10 ) ) % 10;
      return variable % 10;
    }
  }