I have the following which works but was wondering if there\'s a better way. Better meaning more efficient and or more compact.
The function checks a trie to see if the w