title: Count Of Pairs Satisfying The Given Condition
signature: count_of_pairs_satisfying_the_given_condition <- function(a, b) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(a, b, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(a, b), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          31L, 91L, 
          31L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          72L, 85L, 
          72L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          23L, 49L, 
          23L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          42L, 32L, 
          42L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          13L, 7L, 
          0L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          93L, 5L, 
          0L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          33L, 32L, 
          33L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          94L, 76L, 
          94L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          60L, 60L, 
          60L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          11L, 26L, 
          11L
      )))
  
  }
  
  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;
  }