0 ms, faster than 100.00% | Memory Usage: 6.1 MB, less than 100.00%
inspired from https://leetcode.com/pintushingade100 \'s brilliant solution.\n\nclass Solution {\npublic:\n    int countSubstrings(string&s, string&t) {\n       
inspired from https://leetcode.com/pintushingade100 \'s brilliant solution.\n```\nclass Solution {\npublic:\n    int countSubstrings(string&s, string&t) {\n        int szs=s.length(),szt=t.length(),res=0;\n        for(int i=0;i<szs;++i){\n            for(int j=0;j<szt;++j){\n                int x=i,y=j,dif=0;\n                for(;x<szs && y<szt && dif<2;++x,++y){\n                    if(s[x]!=t[y])\n                        ++dif;\n                    if(dif==1)\n                        ++res;\n                }\n            }\n        }\n        return res;\n    }\n};\n```
[]