title: Count Of Pairs Satisfying The Given Condition
signature: class Solution {
  
      public Integer countOfPairsSatisfyingTheGivenCondition(Integer a, Integer b) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer a, Integer b, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(a, b,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(31, 91, 31);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(72, 85, 72);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(23, 49, 23);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(42, 32, 42);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(13, 7, 0);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(93, 5, 0);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(33, 32, 33);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(94, 76, 94);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(60, 60, 60);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(11, 26, 11);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer a, Integer b, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(a, b),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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;
  }