Skip to content

Commit 54b3917

Browse files
committed
alphabet
1 parent f1d5d32 commit 54b3917

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

colors/try-hard.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export function getNodes(root, word) {
7070
return result;
7171
}
7272

73+
const alphabet = [..."abcdefghijklmnopqrstuvwxyz"];
74+
7375
/**
7476
* Returns the longest paths matching a prefix of the input word including wildcards.
7577
* @param { LetterNode } root
@@ -89,7 +91,7 @@ export function getNodesWithWildcards(root, word) {
8991
console.log(remaining);
9092
// Get all the possible nodes that can act as roots for the new word
9193
/** @type LetterNode[] */
92-
const roots = [..."abcdefghijklmnopqrstuvwxyz"].map(k => current[k]).filter(r => r !== undefined);
94+
const roots = alphabet.map(k => current[k]).filter(r => r !== undefined);
9395
// console.log(roots);
9496

9597
// If there aren't any further nodes, just return the result we have

0 commit comments

Comments
 (0)