title: Number Digits Product Two Numbers 1
signature: function numberDigitsProductTwoNumbers1($a, $b) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($a, $b, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($a, $b), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        97, 91, 
        4));
      
      printf("TEST-1...%s\n",driver(
        52, 49, 
        4));
      
      printf("TEST-2...%s\n",driver(
        95, 34, 
        4));
      
      printf("TEST-3...%s\n",driver(
        35, 40, 
        4));
      
      printf("TEST-4...%s\n",driver(
        40, 85, 
        4));
      
      printf("TEST-5...%s\n",driver(
        18, 97, 
        4));
      
      printf("TEST-6...%s\n",driver(
        92, 15, 
        4));
      
      printf("TEST-7...%s\n",driver(
        73, 98, 
        4));
      
      printf("TEST-8...%s\n",driver(
        10, 62, 
        3));
      
      printf("TEST-9...%s\n",driver(
        82, 22, 
        4));
      
  }
  
  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;
  }