title: Count Of Pairs Satisfying The Given Condition
signature: def countOfPairsSatisfyingTheGivenCondition(a: Int, b: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(a: Int, b: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        31, 91, 
        31    
      )}")   
  
  
      println(s"TEST-1...${driver(
        72, 85, 
        72    
      )}")   
  
  
      println(s"TEST-2...${driver(
        23, 49, 
        23    
      )}")   
  
  
      println(s"TEST-3...${driver(
        42, 32, 
        42    
      )}")   
  
  
      println(s"TEST-4...${driver(
        13, 7, 
        0    
      )}")   
  
  
      println(s"TEST-5...${driver(
        93, 5, 
        0    
      )}")   
  
  
      println(s"TEST-6...${driver(
        33, 32, 
        33    
      )}")   
  
  
      println(s"TEST-7...${driver(
        94, 76, 
        94    
      )}")   
  
  
      println(s"TEST-8...${driver(
        60, 60, 
        60    
      )}")   
  
  
      println(s"TEST-9...${driver(
        11, 26, 
        11    
      )}")   
  
  }
  
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;
  }