Easy to understand for beginners as well(runtime 64ms 100%)
\nvar countSubstrings = function(s, t) {\n    let res=0;\n    for(let i=0;i<s.length;i++){\n        for(let j=0;j<t.length;j++){\n            let diff=0;\n     
```\nvar countSubstrings = function(s, t) {\n    let res=0;\n    for(let i=0;i<s.length;i++){\n        for(let j=0;j<t.length;j++){\n            let diff=0;\n            let x=i;\n            let y=j;\n            while(x<s.length && y<t.length){\n                if(s[x]!==t[y]){\n                    diff++\n                }\n                if(diff===1)res++\n                if(diff>1) break;\n                x++\n                y++\n            }\n        }\n    }\n    return res;\n};\n```\nRuntime: 64 ms, faster than 100.00% of JavaScript online submissions for Count Substrings That Differ by One Character.\nMemory Usage: 39.2 MB, less than 63.16% of JavaScript online submissions for Count Substrings That Differ by One Character.
['JavaScript']