title: Count Of Pairs Satisfying The Given Condition
signature: function count_of_pairs_satisfying_the_given_condition(a, b)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(a, b, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(a, b), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(31, 91, 31);
      @printf("TEST-0...%s\n",result);
      
      result = driver(72, 85, 72);
      @printf("TEST-1...%s\n",result);
      
      result = driver(23, 49, 23);
      @printf("TEST-2...%s\n",result);
      
      result = driver(42, 32, 42);
      @printf("TEST-3...%s\n",result);
      
      result = driver(13, 7, 0);
      @printf("TEST-4...%s\n",result);
      
      result = driver(93, 5, 0);
      @printf("TEST-5...%s\n",result);
      
      result = driver(33, 32, 33);
      @printf("TEST-6...%s\n",result);
      
      result = driver(94, 76, 94);
      @printf("TEST-7...%s\n",result);
      
      result = driver(60, 60, 60);
      @printf("TEST-8...%s\n",result);
      
      result = driver(11, 26, 11);
      @printf("TEST-9...%s\n",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;
  }