title: Count Of Pairs Satisfying The Given Condition
signature: function countOfPairsSatisfyingTheGivenCondition(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(31, 91, 31);
    console.log(`TEST-0...${result}`);
  
    result = driver(72, 85, 72);
    console.log(`TEST-1...${result}`);
  
    result = driver(23, 49, 23);
    console.log(`TEST-2...${result}`);
  
    result = driver(42, 32, 42);
    console.log(`TEST-3...${result}`);
  
    result = driver(13, 7, 0);
    console.log(`TEST-4...${result}`);
  
    result = driver(93, 5, 0);
    console.log(`TEST-5...${result}`);
  
    result = driver(33, 32, 33);
    console.log(`TEST-6...${result}`);
  
    result = driver(94, 76, 94);
    console.log(`TEST-7...${result}`);
  
    result = driver(60, 60, 60);
    console.log(`TEST-8...${result}`);
  
    result = driver(11, 26, 11);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    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;
  }