C++ || Brute Force || Two pointers || 100% fast
\nclass Solution {\npublic:\n    int countSubstrings(string s, string t) {\n        int ans=0;\n        for(int i=0;i<s.size();i++){\n            for(int j=0;j<
```\nclass Solution {\npublic:\n    int countSubstrings(string s, string t) {\n        int ans=0;\n        for(int i=0;i<s.size();i++){\n            for(int j=0;j<t.size();j++){\n                int x=i;\n                int y=j;\n                int diff=0;\n                while(x<s.size()&& y<t.size()){\n                    if(s[x]!=t[y]){\n                        diff++;\n                    }\n                    if(diff==1){\n                        ans++;\n                    }\n                    if(diff>1){\n                        break;\n                    }\n                    x++;\n                    y++;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
[]