1
var spellchecker = function (wordlist, queries) {2
const baseList = new Set(wordlist.reverse());3
const loweredList = wordlist.reduce(4
(map, word) => ((map[normalize(word)] = word), map),7
const replacedList = wordlist.reduce(8
(map, word) => ((map[repVowels(word)] = word), map),13
(baseList.has(word) && word) ||14
loweredList[normalize(word)] ||15
replacedList[repVowels(word)] ||19
var normalize = function (word) {20
return word.toLowerCase();22
var repVowels = function (word) {23
return normalize(word).replace(/[eiou]/g, "a");