export function wordFactorial(words: string[]): Set { const combinations: Set = new Set([]); for (let i = 0; i < words.length; i++) { let inner = ""; for (let ii = i; ii < words.length; ii++) { inner += (ii > i ? " " : "") + words[ii].toLowerCase(); combinations.add(inner); } } return combinations; }