O(mn)
\nclass Solution:\n    def countSubstrings(self, s: str, t: str) -> int:\n        \n        if s == t: return 0        \n        len_s = len(s)        \n       
```\nclass Solution:\n    def countSubstrings(self, s: str, t: str) -> int:\n        \n        if s == t: return 0        \n        len_s = len(s)        \n        len_t = len(t)        \n        ans = 0        \n        for i in range(len_s):            \n            for j in range(len_t):                \n                \n                Si, Tj, d = i,j,0            \n                \n                while Si < len_s and Tj < len_t:\n\n                    if s[Si] != t[Tj]:\n\n                        d += 1\n\n                    if d == 1:\n                        ans += 1\n                    \n                    if d == 2:\n                        break\n\n                    Si += 1\n                    Tj += 1\n                \n        return ans\n```
['Python', 'Python3']