AAlgoLoopSpaced repetition for LeetCode

Trie

A trie (prefix tree) stores strings by shared prefixes, so a prefix lookup or autocompletion costs only the length of the query, not the size of the dictionary. Reach for it on word-search, prefix-matching, and dictionary problems.

4 LeetCode problems solved with the Trie pattern. Practice them with spaced repetition so the pattern sticks.

See the full solution

The complete approach, reference solutions in 5 languages, and a step-by-step visualization — then add this problem to your spaced-repetition schedule.

Start free →