Skip to content
Optimal Lab

Practice · 3 problems

Tries

0 of 3 solved on this device

Watch it first · interactiveTrie: prefix lookups →
  1. 095Implement Trie (Prefix Tree)Implement a trie supporting insert(word), search(word) returning whether the exact word was inserted, and startsWith(prefix) returning whether any inserted word has that prefix.Medium
  2. 096Design Add and Search Words Data StructureDesign a structure with addWord(word) and search(word), where the search string may contain '.' as a wildcard matching any single letter. Implement the WordDictionary class.Medium
  3. 097Word Search IIGiven an m x n board of characters and a list of words, return all words from the list that can be formed from sequentially adjacent cells (horizontal or vertical). A cell may not be reused within a single word.Hard