add snippet to archive
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "30-seconds-of-code",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@ -144,7 +144,6 @@ join:array
|
||||
JSONToFile:node,json
|
||||
last:array
|
||||
lcm:math,recursion
|
||||
levenshteinDistance:string,utility
|
||||
longestItem:array,string,utility
|
||||
lowercaseKeys:object
|
||||
luhnCheck:math,utility
|
||||
|
||||
@ -3,8 +3,8 @@ 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);
|
||||
for(i = 1;i <= string2.length;i++){
|
||||
for(j = 1;j<=string1.length; j++){
|
||||
for(let i = 1;i <= string2.length;i++){
|
||||
for(let j = 1;j<=string1.length; j++){
|
||||
if(string2[i-1] === string1[j-1]){
|
||||
matrix[i][j] = matrix[i-1][j-1];
|
||||
}
|
||||
|
||||
21
test/testlog
21
test/testlog
@ -1,4 +1,4 @@
|
||||
Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC)
|
||||
Test log for: Mon Feb 26 2018 15:00:57 GMT+0530 (India Standard Time)
|
||||
|
||||
> 30-seconds-of-code@0.0.2 test R:\github\30-seconds-of-code
|
||||
> tape test/**/*.test.js | tap-spec
|
||||
@ -538,12 +538,6 @@ Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC)
|
||||
√ Returns own methods
|
||||
√ Returns own and inherited methods
|
||||
|
||||
Testing fuzzySearch
|
||||
|
||||
√ fuzzySearch is a Function
|
||||
√ Provided examples work
|
||||
√ Provided examples work
|
||||
|
||||
Testing gcd
|
||||
|
||||
√ gcd is a Function
|
||||
@ -1529,8 +1523,8 @@ Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC)
|
||||
|
||||
Testing stableSort
|
||||
|
||||
✔ stableSort is a Function
|
||||
✔ Array is properly sorted
|
||||
√ stableSort is a Function
|
||||
√ Array is properly sorted
|
||||
|
||||
Testing standardDeviation
|
||||
|
||||
@ -1914,15 +1908,14 @@ Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC)
|
||||
√ zipWith is a Function
|
||||
√ Runs the function provided
|
||||
√ Runs promises in series
|
||||
√ Works as expecting, passing arguments properly
|
||||
√ Sends a GET request
|
||||
√ Works as expecting, passing arguments properly
|
||||
√ Sends a POST request
|
||||
√ Works with multiple promises
|
||||
|
||||
|
||||
|
||||
total: 974
|
||||
passing: 974
|
||||
duration: 2.9s
|
||||
total: 973
|
||||
passing: 973
|
||||
duration: 3s
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user