

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 9
click for more info
Not enough gems
Cost: 6 gems
1: Tries
incomplete
2: Exists
incomplete
3: Prefix Matching
incomplete
4: Words With Prefix
incomplete
5: Find Matches
incomplete
6: Find Matches Review
incomplete
7: Longest Common Prefix
incomplete
8: Advanced Find Matches
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
In a trie, "hello", "help" and "hi" would be represented as:
{"h": {"e": {"l": {"l": {"o": {"*": True}}, "p": {"*": True}}}, "i": {"*": True}}}
Complete the search_level function. This recursive function collects all complete words starting from the current trie level. It takes the current dictionary level, the accumulated prefix string, and the list of words found.
Complete the words_with_prefix function. This finds all words in the trie that begin with a given prefix.