C++ || 0 ms || 100% faster || 2 pointer
\n\nstatic auto _____ = [](){\n    std::ios::sync_with_stdio(0);\n    std::cin.tie(0);\n    return 0;\n}();\n\nclass Solution {\npublic:\n    int countSubstring
```\n\nstatic auto _____ = [](){\n    std::ios::sync_with_stdio(0);\n    std::cin.tie(0);\n    return 0;\n}();\n\nclass Solution {\npublic:\n    int countSubstrings(string s, string t) {\n        int ans=0;\n        for(int i=0; i<s.length(); i++){\n            for(int j=0; j<t.length(); j++){\n                int x=i, y=j, diff=0;\n                while(x<(int)s.length() && y<(int)t.length()){\n                    if(s[x++] != t[y++]){\n                        diff++;\n                        if(diff>1)break;\n                    }\n                    if(diff==1)ans++;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```\n# if you find it helpful, plz upvote
[]