Trie
11 problems
A trie (prefix tree) stores strings character by character, enabling O(L) insert, search, and prefix queries where L is string length. Use it for autocomplete, word search in a grid, longest common prefix, and IP routing. Each node has up to 26 children (for lowercase letters).
- 212.Word Search IIHard
- 386.Lexicographical NumbersMedium
- 440.K-th Smallest in Lexicographical OrderHard
- 820.Short Encoding of WordsMedium
- 1233.Remove Sub-Folders from the FilesystemMedium
- 1938.Maximum Genetic Difference QueryUnknown
- 1948.Delete Duplicate Folders in SystemUnknown
- 2416.Sum of Prefix Scores of StringsHard
- 2707.Extra Characters in a StringMedium
- 3042.Count Prefix and Suffix Pairs IEasy
- 3043.Find the Length of the Longest Common PrefixEasy