[C++] Brute Force, 4ms
Time complexity, O(n^3) c++ class Solution { public:   int countSubstrings(string s, string t) {     int cnt = 0;     for (int i = 0; i < s.length(); i++) {    
Time complexity, `O(n^3)`

```c++
class Solution {
public:
  int countSubstrings(string s, string t) {
    int cnt = 0;
    for (int i = 0; i < s.length(); i++) {
      for (int j = 0; j < t.length(); j++) {
        int diff = 0;
        for (int k = 0; k < std::min(s.length() - i, t.length() - j); k++) {
          if (s[k + i] != t[k + j]) diff++;
          if (diff > 1) break;
          cnt += diff;
        }
      }
    }
    return cnt;
  }
};
```
[]