title: Find Last Digit Factorial Divides Factorial B
signature: function findLastDigitFactorialDividesFactorialB(a: number, b: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(a: number, b: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(79, 84, 0);
    console.log(`TEST-0...${result}`);
  
    result = driver(61, 29, 1);
    console.log(`TEST-1...${result}`);
  
    result = driver(39, 77, 0);
    console.log(`TEST-2...${result}`);
  
    result = driver(39, 65, 0);
    console.log(`TEST-3...${result}`);
  
    result = driver(61, 78, 0);
    console.log(`TEST-4...${result}`);
  
    result = driver(86, 73, 1);
    console.log(`TEST-5...${result}`);
  
    result = driver(7, 92, 0);
    console.log(`TEST-6...${result}`);
  
    result = driver(86, 50, 1);
    console.log(`TEST-7...${result}`);
  
    result = driver(86, 63, 1);
    console.log(`TEST-8...${result}`);
  
    result = driver(11, 2, 1);
    console.log(`TEST-9...${result}`);
  
  };
  
  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;
    }
  }