We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Exists

In a trie, "hello", "help" and "hi" would be represented as:

{"h": {"e": {"l": {"l": {"o": {"*": True}}, "p": {"*": True}}}, "i": {"*": True}}}

Assignment

We want to be able to see what words have been added to the trie.

Complete the exists method. It takes a word as input, and should return True if the word exists in the trie, and False if it doesn't.