title: Count Of Pairs Satisfying The Given Condition
signature: function count_of_pairs_satisfying_the_given_condition(a, b)
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(31, 91, 31)
      print(string.format("TEST-0...%s",result))
  
      result = driver(72, 85, 72)
      print(string.format("TEST-1...%s",result))
  
      result = driver(23, 49, 23)
      print(string.format("TEST-2...%s",result))
  
      result = driver(42, 32, 42)
      print(string.format("TEST-3...%s",result))
  
      result = driver(13, 7, 0)
      print(string.format("TEST-4...%s",result))
  
      result = driver(93, 5, 0)
      print(string.format("TEST-5...%s",result))
  
      result = driver(33, 32, 33)
      print(string.format("TEST-6...%s",result))
  
      result = driver(94, 76, 94)
      print(string.format("TEST-7...%s",result))
  
      result = driver(60, 60, 60)
      print(string.format("TEST-8...%s",result))
  
      result = driver(11, 26, 11)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
source_py: def count_of_pairs_satisfying_the_given_condition(a, b):
      s = str(b)
      i = 0
      while (i < len(s)):
          if (s[i] != '9'):
              break
          i += 1
      result = 0
      if (i == len(s)):
          result = (a * len(s))
      else:
          result = (a * (len(s) - 1))
      return result
source_cpp: int count_of_pairs_satisfying_the_given_condition(int a, int b) {
    string s = to_string ( b );
    int i;
    for ( i = 0;
    i < s . length ( );
    i ++ ) {
      if ( s [ i ] != '9' ) break;
    }
    int result;
    if ( i == s . length ( ) ) result = a * s . length ( );
    else result = a * ( s . length ( ) - 1 );
    return result;
  }