title: Find Number Times String Occurs Given String 1
signature: def findNumberTimesStringOccursGivenString1(a: String, b: String) = {
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: String, b: String, 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(
        "fZOKCdZ Lav", "fKA", 
        0    
      )}")   
  
  
      println(s"TEST-1...${driver(
        "2", "187012", 
        0    
      )}")   
  
  
      println(s"TEST-2...${driver(
        "1000001110", "0", 
        6    
      )}")   
  
  
      println(s"TEST-3...${driver(
        "IAOyBzgIWHo", "oA", 
        0    
      )}")   
  
  
      println(s"TEST-4...${driver(
        "211806", "10", 
        2    
      )}")   
  
  
      println(s"TEST-5...${driver(
        "1", "001011100", 
        0    
      )}")   
  
  
      println(s"TEST-6...${driver(
        "CVaQTG", "CT", 
        1    
      )}")   
  
  
      println(s"TEST-7...${driver(
        "6265187228", "628", 
        6    
      )}")   
  
  
      println(s"TEST-8...${driver(
        "10111101101000", "01111", 
        35    
      )}")   
  
  
      println(s"TEST-9...${driver(
        "vEi", "bigsvkQG", 
        0    
      )}")   
  
  }
  
source_py: def find_number_times_string_occurs_given_string_1(a, b):
      m = len(a)
      n = len(b)
      lookup = [([0] * (n + 1)) for i in range((m + 1))]
      for i in range((n + 1)):
          lookup[0][i] = 0
      for i in range((m + 1)):
          lookup[i][0] = 1
      for i in range(1, (m + 1)):
          for j in range(1, (n + 1)):
              if (a[(i - 1)] == b[(j - 1)]):
                  lookup[i][j] = (lookup[(i - 1)][(j - 1)] + lookup[(i - 1)][j])
              else:
                  lookup[i][j] = lookup[(i - 1)][j]
      return lookup[m][n]
source_cpp: int find_number_times_string_occurs_given_string_1(string a, string b) {
    int m = a . length ( );
    int n = b . length ( );
    int lookup [ m + 1 ] [ n + 1 ] = {
      {
        0 }
      };
      for ( int i = 0;
      i <= n;
      ++ i ) lookup [ 0 ] [ i ] = 0;
      for ( int i = 0;
      i <= m;
      ++ i ) lookup [ i ] [ 0 ] = 1;
      for ( int i = 1;
      i <= m;
      i ++ ) {
        for ( int j = 1;
        j <= n;
        j ++ ) {
          if ( a [ i - 1 ] == b [ j - 1 ] ) lookup [ i ] [ j ] = lookup [ i - 1 ] [ j - 1 ] + lookup [ i - 1 ] [ j ];
          else lookup [ i ] [ j ] = lookup [ i - 1 ] [ j ];
        }
      }
      return lookup [ m ] [ n ];
    }