Java easy solution | 3ms
\nclass Solution {\n    public int countSubstrings(String s, String t) {\n        int lenS = s.length();\n        int lenT = t.length();\n        int count = 0;
```\nclass Solution {\n    public int countSubstrings(String s, String t) {\n        int lenS = s.length();\n        int lenT = t.length();\n        int count = 0;\n        for(int i=0;i<lenS;i++) {\n            for(int j=0;j<lenT;j++) {\n                int diff = 0;\n                for(int m=i,n=j ; m<lenS && n < lenT ; m++,n++) {\n                    if(s.charAt(m) != t.charAt(n)) {\n                        diff++;\n                    }\n                    if(diff == 1) {\n                        count++;\n                    }\n                    if(diff == 2) {\n                        break;\n                    }\n                }\n            }\n        }\n        return count;\n    }\n}\n```
['Java']