Without DP
int countSubstrings(string s, string t) {\n        \n        int ans =0;\n        int i,j;\n        int m = s.size();\n        int n = t.size();\n        for(i=
int countSubstrings(string s, string t) {\n        \n        int ans =0;\n        int i,j;\n        int m = s.size();\n        int n = t.size();\n        for(i=0;i<m;i++)\n        {\n            for(j=0;j<n;j++)\n            {\n                int x=i;\n                int y=j;\n                int d=0;\n                while(x<m && y<n)\n                {\n                    if(s[x]!=t[y])\n                    {\n                        d++;\n                    }\n                    if(d==1)\n                    {\n                        ans++;\n                    }\n                    if(d==2)\n                    {\n                        break;\n                    }\n                    x++;\n                    y++;\n                }\n            }\n        }\n        return ans;\n    }
['C']