Travis build: 176 [cron]

This commit is contained in:
30secondsofcode
2018-08-02 19:51:06 +00:00
parent ec6a8469da
commit 43af1264ee
10 changed files with 1671 additions and 1639 deletions

View File

@ -1,2 +1,3 @@
const indexOfAll = (arr, val) => arr.reduce((acc, el, i) => el === val ? [...acc, i] : acc, []);
const indexOfAll = (arr, val) => (arr, val) =>
arr.reduce((acc, el, i) => (el === val ? [...acc, i] : acc), []);
module.exports = indexOfAll;

View File

@ -1,8 +1,8 @@
const levenshteinDistance = (string1, string2) => {
if(string1.length === 0) return string2.length;
if(string2.length === 0) return string1.length;
let matrix = Array(string2.length + 1).fill(0).map((x, i) => [i]);
matrix[0] = Array(string1.length + 1).fill(0).map((x, i) => i);
let matrix = Array(string2.length + 1).fill(0).map((x,i) => [i]);
matrix[0] = Array(string1.length + 1).fill(0).map((x,i) => i);
for(let i = 1; i <= string2.length; i++) {
for(let j = 1; j<=string1.length; j++) {
if(string2[i-1] === string1[j-1]) {

File diff suppressed because it is too large Load Diff