Search/Sorts algoruthms : remove live code & console.log, leave examples as comments.

This commit is contained in:
Eric Lavault
2021-10-11 12:29:03 +02:00
parent 8a7be96c9d
commit 74f296578a
22 changed files with 121 additions and 197 deletions

View File

@ -35,7 +35,7 @@ function makeTable (str) {
}
// Find all the words that matches in a given string `str`
function stringSearch (str, word) {
export function stringSearch (str, word) {
// find the prefix table in O(n)
const prefixes = makeTable(word)
const matches = []
@ -80,4 +80,4 @@ function stringSearch (str, word) {
return matches
}
console.log(stringSearch('Hello search the position of me', 'pos'))
// stringSearch('Hello search the position of me', 'pos')