c++ very simple solution
\nclass Solution {\npublic:\n    int countSubstrings(string s, string t) {\n        int SN = s.length(), TN = t.length();\n        int res = 0;\n        for(int
```\nclass Solution {\npublic:\n    int countSubstrings(string s, string t) {\n        int SN = s.length(), TN = t.length();\n        int res = 0;\n        for(int i = 0; i < SN; ++i) {\n            for(int j = 0; j < TN; ++j) {\n                int p = i, q = j, diff = 0;\n                while(p < SN && q < TN) {\n                    if(s[p++] != t[q++]) {\n                        diff++;\n                        if(diff > 1) {\n                            break;\n                        }\n                    }\n                    if(diff == 1) {\n                        res++;\n                    }\n                }\n            }\n        }\n        return res;\n    }\n};\n```
[]