String Manipulation Flashcards
1
Q
trie tree
A
operations: insert a word, search a word, has word startsWith certain prefix
TrieNode can have multiple children, save children as a dictionary
stop word
2
Q
minimum substring containing all the characters in the target string
A
sliding window:
- move end until a valid substring is found
- move start until it’s the last position making it still valid
- save the valid substring length (and start and end position)
- move start by 1 (no longer valid)
- go back to step 1