fix linting errors
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// not the fastest
|
||||
// taken from stackoverflow, it's crap i know.
|
||||
|
||||
module.exports = function (a, b) {
|
||||
if (a.length === 0) return b.length;
|
||||
@@ -8,20 +8,20 @@ module.exports = function (a, b) {
|
||||
|
||||
// increment along the first column of each row
|
||||
var i;
|
||||
for(i = 0; i <= b.length; i++){
|
||||
for (i = 0; i <= b.length; i++) {
|
||||
matrix[i] = [i];
|
||||
}
|
||||
|
||||
// increment each column in the first row
|
||||
var j;
|
||||
for(j = 0; j <= a.length; j++){
|
||||
for (j = 0; j <= a.length; j++) {
|
||||
matrix[0][j] = j;
|
||||
}
|
||||
|
||||
// Fill in the rest of the matrix
|
||||
for(i = 1; i <= b.length; i++){
|
||||
for(j = 1; j <= a.length; j++){
|
||||
if(b.charAt(i - 1) == a.charAt(j - 1)){
|
||||
for (i = 1; i <= b.length; i++) {
|
||||
for (j = 1; j <= a.length; j++) {
|
||||
if (b.charAt(i - 1) == a.charAt(j - 1)) {
|
||||
matrix[i][j] = matrix[i - 1][j - 1];
|
||||
} else {
|
||||
matrix[i][j] = Math.min(
|
||||
|
||||
Reference in New Issue
Block a user