65 std::shared_ptr<TrieNode> curr,
67 if (word.size() == index) {
68 if (curr->isEndOfWord) {
69 curr->isEndOfWord =
false;
77 size_t idx = word[index] -
'a';
81 if (!curr->character[idx]) {
82 throw std::runtime_error(std::move(std::string(
"Word not found.")));
85 curr->character[idx] =