Using a nested for() loop is inefficient, can you do it more efficient than the native String.indexOf() method? Without nesting for loops or recursion.
Anónimo
Convert the strings to objects with each word being added as a property to speed up the lookup. I had heard of this technique but never done it myself.