title: Find Number Times String Occurs Given String 1
signature: pub fn find_number_times_string_occurs_given_string_1(a: String, b: String) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(a: String, b: String, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(a, b), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "fZOKCdZ Lav".to_string(), "fKA".to_string(), 
        0
      ));
      
      println!("TEST-1...{}", driver(
        "2".to_string(), "187012".to_string(), 
        0
      ));
      
      println!("TEST-2...{}", driver(
        "1000001110".to_string(), "0".to_string(), 
        6
      ));
      
      println!("TEST-3...{}", driver(
        "IAOyBzgIWHo".to_string(), "oA".to_string(), 
        0
      ));
      
      println!("TEST-4...{}", driver(
        "211806".to_string(), "10".to_string(), 
        2
      ));
      
      println!("TEST-5...{}", driver(
        "1".to_string(), "001011100".to_string(), 
        0
      ));
      
      println!("TEST-6...{}", driver(
        "CVaQTG".to_string(), "CT".to_string(), 
        1
      ));
      
      println!("TEST-7...{}", driver(
        "6265187228".to_string(), "628".to_string(), 
        6
      ));
      
      println!("TEST-8...{}", driver(
        "10111101101000".to_string(), "01111".to_string(), 
        35
      ));
      
      println!("TEST-9...{}", driver(
        "vEi".to_string(), "bigsvkQG".to_string(), 
        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 ];
    }