String & SubString Flashcards

1
Q

Longest substring without repeating character

A
  1. two pointer with one pass
  2. Store the i pointer with j + 1
  3. If map contains, get the i = max(i, get())
  4. Always calculate maxLength = max(maxL, j - i + 1) // + 1coz every char is substring with len 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly