Forum Discussion
nganapathiraju
9 years agoFormer Employee
You probably dont need to use libraries for this.
There are some built in functions sl.range function and lamda functions of map on the arrays to come up with an algorithm.
sl.range($word.length).map(len => $word.toLowerCase().slice(0, len + 1))
assign this to wordArray
$wordArray.map(elem => { wordArray: elem, found: $inputArray.indexOf(elem) != -1 })
Lambda functions are very powerful and you can put this to your use for coming up with the algorithm.