LeetCode 820: Short Encoding of Words
A suffix-removal solution for finding the shortest reference string that can encode every word.
20 notes
A suffix-removal solution for finding the shortest reference string that can encode every word.
A clear explanation of finding the longest buildable word using sorting and a hash set.
Support fast prefix and suffix queries by indexing every prefix-suffix combination with the largest word index.
Design a map that supports key-value insertion and prefix-sum queries using a hash map and trie.
A trie-based solution for replacing each derivative word with the shortest matching root.
A trie-based design for returning the top three historical sentences for a typed prefix.
A clear design guide for implementing an in-memory file system with directory listing, directory creation, file append, and file read operations.
A clear explanation of generating minimal unique word abbreviations using grouping and trie prefixes.
A clear explanation of finding all words that can be formed by concatenating at least two shorter words from the same list.
Find the k-th integer in lexicographical order without generating all numbers, using prefix counting over a conceptual trie.
A clear explanation of building all word squares using backtracking with prefix pruning.
A clear explanation of finding the maximum XOR of two numbers using greedy bit prefixes.
A clear explanation of generating numbers from 1 to n in lexicographical order using an iterative DFS-style traversal.
A clear explanation of Palindrome Pairs using reversed-word lookup and palindrome split checks.
A clear explanation of finding multiple words in a character board using a Trie and DFS backtracking.
A clear explanation of designing a word dictionary with addWord and wildcard search using a Trie and DFS.
A clear explanation of implementing a Trie with insert, search, and startsWith operations.
Decide whether a string can be segmented into dictionary words using dynamic programming over prefixes.
Trie variants including compressed, Patricia, ternary, XOR, suffix trees, Aho-Corasick, DAWG, HAMT, and concurrent prefix structures.
Search for a string key in a prefix tree by following character transitions.