title: Find First Natural Number Whose Factorial Divisible X
signature: function findFirstNaturalNumberWhoseFactorialDivisibleX(x: 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(x: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(x),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(67, 66);
    console.log(`TEST-0...${result}`);
  
    result = driver(47, 46);
    console.log(`TEST-1...${result}`);
  
    result = driver(57, 19);
    console.log(`TEST-2...${result}`);
  
    result = driver(89, 88);
    console.log(`TEST-3...${result}`);
  
    result = driver(67, 66);
    console.log(`TEST-4...${result}`);
  
    result = driver(40, 5);
    console.log(`TEST-5...${result}`);
  
    result = driver(16, 6);
    console.log(`TEST-6...${result}`);
  
    result = driver(83, 82);
    console.log(`TEST-7...${result}`);
  
    result = driver(93, 31);
    console.log(`TEST-8...${result}`);
  
    result = driver(43, 42);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def find_first_natural_number_whose_factorial_divisible_x(x):
      i = 1
      fact = 1
      for i in range(1, x):
          fact = (fact * i)
          if ((fact % x) == 0):
              break
      return i
source_cpp: int find_first_natural_number_whose_factorial_divisible_x(int x) {
    int i = 1;
    int fact = 1;
    for ( i = 1;
    i < x;
    i ++ ) {
      fact = fact * i;
      if ( fact % x == 0 ) break;
    }
    return i;
  }