SImple JAVA Solution
\nclass Solution {\n    public int countSubstrings(String s, String t) {\n        int count=0;\n        for(int i=0;i<s.length();i++){\n            for(int j=0;
```\nclass Solution {\n    public int countSubstrings(String s, String t) {\n        int count=0;\n        for(int i=0;i<s.length();i++){\n            for(int j=0;j<t.length();j++){\n                int x=i;\n                int y=j;\n                int d=0;\n                while(x<s.length() && y<t.length()){\n                    if(s.charAt(x)!=t.charAt(y)){\n                        d++;\n                    }\n                    if(d==1) count++;\n                    if(d==2) break;\n                    x++;\n                    y++;\n                }\n            }\n        }\n        return count;\n    }\n}\n```
['Java']