

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 8
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
Let's use our Trie to find the longest common prefix of a list of words. This feature can be used in LockedIn to display suggestions when users are searching for their connections.
Complete the longest_common_prefix method. It returns the longest common prefix among the words in the trie.
Here's the syntax for an intentional infinite loop. Always remember to include an exit condition so it doesn't actually continue forever.
while True:
if exit_condition == True:
break