title: Find Last Digit Factorial Divides Factorial B
signature: find_last_digit_factorial_divides_factorial_b <- function(a, b) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(a, b, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(a, b), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          79L, 84L, 
          0L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          61L, 29L, 
          1L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          39L, 77L, 
          0L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          39L, 65L, 
          0L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          61L, 78L, 
          0L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          86L, 73L, 
          1L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          7L, 92L, 
          0L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          86L, 50L, 
          1L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          86L, 63L, 
          1L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          11L, 2L, 
          1L
      )))
  
  }
  
  main()
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;
    }
  }