c++||easy to understand
```\nclass Solution {\npublic:\n    int countSubstrings(string s, string t) \n    {\n        int res=0;\n        int n=s.size(),m=t.size();\n        for(int i=0
```\nclass Solution {\npublic:\n    int countSubstrings(string s, string t) \n    {\n        int res=0;\n        int n=s.size(),m=t.size();\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<m;j++)\n            {\n                if(s[i]!=t[j])\n                {\n                    int l=1,r=1;\n                    while(min(i-l,j-l)>=0&&s[i-l]==t[j-l])\n                        l++;\n                    while(i+r<n&&j+r<m&&s[i+r]==t[j+r])\n                        r++;\n                    res+=l*r;\n                }\n            }\n        }\n        return res;\n        \n    }\n};\n//If you like the solution plz upvote.
['C']