SOURCE

function minDistance(s1, s2) {
    const l1 = s1.length;
    const l2 = s2.length;
    const matrix = [];
    for (let i = 0; i <= l1.length; i++) {
        matrix[i] = []
        for (let j = 0; j <= l2.length; j++) {
            if (i === 0) {
                matrix[i][j] = j
            } else if (j === 0) {
                matrix[i][j] = i
            } else {
                let cont = 0;
if(s1[i-1]!==s2[j-1]){
    cont =1
}
            }
        }
    }
}

console.log(minDistance('abc', 'abe'))
console 命令行工具 X clear

                    
>
console