[c++] || two pointer Approach || 100% faster than any other c++ solution.
\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;
```\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 temp = 0;\n                while( x<s.size() && y<t.size() ){\n                    if(s[x]!=t[y]){\n                        temp++;\n                    }\n                    if(temp==1){\n                        ans += 1;\n                    }\n                    if(temp>=2){\n                        break;\n                    }\n                    x++;\n                    y++;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
[]