Skip to content

Commit

Permalink
Remove doubles
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel-Karasu committed Apr 15, 2024
1 parent 144db59 commit 676fcfd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function generate_possibilities(words_length = [], letters = {}) {
words.normalize("NFD").replaceAll(/[\u0300-\u036f]/g, '').split('\n').forEach(word => {
if (words_length.includes(word.length) && check_string(word)) dictionary_by_length[word.length].push(word);
});
Object.keys(dictionary_by_length).forEach(length => dictionary_by_length[length] = [...new Set(dictionary_by_length[length])])

possibilities = dictionary_by_length[words_length[0]];
for (let length of words_length.slice(1)) {
Expand Down

0 comments on commit 676fcfd

Please sign in to comment.