title: Number Digits Product Two Numbers 1
signature: function numberDigitsProductTwoNumbers1(a, b) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(a, b, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(97, 91, 4);
    console.log(`TEST-0...${result}`);
  
    result = driver(52, 49, 4);
    console.log(`TEST-1...${result}`);
  
    result = driver(95, 34, 4);
    console.log(`TEST-2...${result}`);
  
    result = driver(35, 40, 4);
    console.log(`TEST-3...${result}`);
  
    result = driver(40, 85, 4);
    console.log(`TEST-4...${result}`);
  
    result = driver(18, 97, 4);
    console.log(`TEST-5...${result}`);
  
    result = driver(92, 15, 4);
    console.log(`TEST-6...${result}`);
  
    result = driver(73, 98, 4);
    console.log(`TEST-7...${result}`);
  
    result = driver(10, 62, 3);
    console.log(`TEST-8...${result}`);
  
    result = driver(82, 22, 4);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
source_py: def number_digits_product_two_numbers_1(a, b):
      if ((a == 0) or (b == 0)):
          return 1
      return (math.floor((math.log10(abs(a)) + math.log10(abs(b)))) + 1)
source_cpp: int number_digits_product_two_numbers_1(int a, int b) {
    if ( a == 0 || b == 0 ) return 1;
    return floor ( log10 ( abs ( a ) ) + log10 ( abs ( b ) ) ) + 1;
  }