func_code_string: #include <bits/stdc++.h>   using namespace std;   long long dp[100003][3], ara[100003], mod = 1000000007, n, m;   long long solve(long long idx, long long sta) {     if (idx == n) {       if (sta == 0 || sta == 2)         return 1;       else {         return 0;       }     } else if (dp[idx][sta] != -1)       return dp[idx][sta];     else {       long long p = 0, q = 0, r = 0, t, x, y, z;       if (sta == 0) {         p = solve(idx + 1, 0);         x = 1;         z = idx + 1;         if (ara[idx] == 1) {           x = 2;           z = idx + m;         }         q = solve(z, x);       } else if (sta == 1) {         x = 1;         z = idx + 1;         if (ara[idx] == 1) {           x = 2;           z = idx + m;         }         q = solve(z, x);       } else {         p = solve(idx, 0);         q = solve(idx + 1, sta);       }       t = (p + q) % mod;       dp[idx][sta] = t;       return dp[idx][sta];     }   }   int main() {     long long i, k, ans = 1, sc = 1;     string str, ttr, ntr;     cin >> str;     cin >> ttr;     n = str.size();     m = ttr.size();     if (n >= m) {       for (i = 0; i <= n - m; i++) {         if (str[i] == ttr[0]) {           ntr = str.substr(i, m);           if (ntr == ttr) {             ara[i] = 1;           }         }         dp[i][0] = -1;         dp[i][1] = -1;         dp[i][2] = -1;       }     }     if (n >= m) {       for (i = n - m; i <= n; i++) {         dp[i][0] = -1;         dp[i][1] = -1;         dp[i][2] = -1;       }       ans = solve(0, 0);     }     if (ans >= sc)       k = ans - sc;     else {       k = (mod - sc) + ans;     }     printf( %lld n , k);     return 0;   }   