C++ Easy Solution
Code\n\nclass Solution {\npublic:\n    int solve(string& s,string &t,int i,int j,bool diff,vector<vector<vector<int>>>&dp){\n        if(i == s.length() || j == 
# Code\n```\nclass Solution {\npublic:\n    int solve(string& s,string &t,int i,int j,bool diff,vector<vector<vector<int>>>&dp){\n        if(i == s.length() || j == t.length())\n            return 0;\n        if(dp[i][j][diff] != -1)\n            return dp[i][j][diff];\n        if(diff){\n            if(s[i] != t[j])\n                return dp[i][j][diff] = 0;\n            return dp[i][j][diff] = 1 + solve(s,t,i+1,j+1,diff,dp);\n        }\n        if(s[i] != t[j])\n            return dp[i][j][diff] = 1 + solve(s,t,i+1,j+1,true,dp);\n        return dp[i][j][diff] = solve(s,t,i+1,j+1,diff,dp);\n    }\n    int countSubstrings(string s, string t) {\n        int ans = 0;\n        vector<vector<vector<int>>>dp(s.length(),vector<vector<int>>(t.length(),vector<int>(2,-1)));\n        for(int i = 0;i < s.length();i++)\n            for(int j = 0;j < t.length();j++)\n                ans += solve(s,t,i,j,false,dp);\n        return ans;\n    }\n};\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'C++']