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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

minimum substring containing all the characters in the target string

A

sliding window:

  1. move end until a valid substring is found
  2. move start until it’s the last position making it still valid
  3. save the valid substring length (and start and end position)
  4. move start by 1 (no longer valid)
  5. go back to step 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly