title: Find Number Times String Occurs Given String 1
signature: findNumberTimesStringOccursGivenString1 :: String -> String -> Integer
  findNumberTimesStringOccursGivenString1 a b = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: String -> String -> Integer -> String
  driver a b expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME a b) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ("fZOKCdZ Lav") ("fKA") (0) )
  
      printf "TEST-1...%s\n" (driver ("2") ("187012") (0) )
  
      printf "TEST-2...%s\n" (driver ("1000001110") ("0") (6) )
  
      printf "TEST-3...%s\n" (driver ("IAOyBzgIWHo") ("oA") (0) )
  
      printf "TEST-4...%s\n" (driver ("211806") ("10") (2) )
  
      printf "TEST-5...%s\n" (driver ("1") ("001011100") (0) )
  
      printf "TEST-6...%s\n" (driver ("CVaQTG") ("CT") (1) )
  
      printf "TEST-7...%s\n" (driver ("6265187228") ("628") (6) )
  
      printf "TEST-8...%s\n" (driver ("10111101101000") ("01111") (35) )
  
      printf "TEST-9...%s\n" (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 ];
    }