title: Number Digits Product Two Numbers 1
signature: function number_digits_product_two_numbers_1(a, b)
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;
  }
question_info.entry_fn_name: number_digits_product_two_numbers_1
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(a, b, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(a, b) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(97, 91, 4)
      print(string.format("TEST-0...%s",result))
  
      result = driver(52, 49, 4)
      print(string.format("TEST-1...%s",result))
  
      result = driver(95, 34, 4)
      print(string.format("TEST-2...%s",result))
  
      result = driver(35, 40, 4)
      print(string.format("TEST-3...%s",result))
  
      result = driver(40, 85, 4)
      print(string.format("TEST-4...%s",result))
  
      result = driver(18, 97, 4)
      print(string.format("TEST-5...%s",result))
  
      result = driver(92, 15, 4)
      print(string.format("TEST-6...%s",result))
  
      result = driver(73, 98, 4)
      print(string.format("TEST-7...%s",result))
  
      result = driver(10, 62, 3)
      print(string.format("TEST-8...%s",result))
  
      result = driver(82, 22, 4)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 4, "inputs": {"a": 97, "b": 91}}, {"idx": 1, "outputs": 4, "inputs": {"a": 52, "b": 49}}, {"idx": 2, "outputs": 4, "inputs": {"a": 95, "b": 34}}, {"idx": 3, "outputs": 4, "inputs": {"a": 35, "b": 40}}, {"idx": 4, "outputs": 4, "inputs": {"a": 40, "b": 85}}, {"idx": 5, "outputs": 4, "inputs": {"a": 18, "b": 97}}, {"idx": 6, "outputs": 4, "inputs": {"a": 92, "b": 15}}, {"idx": 7, "outputs": 4, "inputs": {"a": 73, "b": 98}}, {"idx": 8, "outputs": 3, "inputs": {"a": 10, "b": 62}}, {"idx": 9, "outputs": 4, "inputs": {"a": 82, "b": 22}}]