Skip to content

Commit 2d39607

Browse files
author
Joseph Luce
authored
Update 076_minimum_window_substring.md
1 parent c66a6f2 commit 2d39607

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

leetcode/hard/076_minimum_window_substring.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ There is one slight problem, python's implementation of string concatention is a
2828
When the question wants the actual substring and not a count, even using a deque will not solve this problem.
2929
So this implementation is technically **O(S * (S+T))** due to python.
3030

31-
When implementing these type of two pointer questions.
32-
I recommend to **avoid using indexes as much as possible and use iterators**.
31+
We could use indexes instead of string slices, however, the code gets complex.
32+
When implementing these type of two pointer questions, I recommend to **avoid using indexes as much as possible and use iterators**.
3333
It is very easy to get a one off error doing these and within a 30 minute timeframe, it is very risky.
34-
Just talk about using indexes instead and you will be fine.
34+
Just talk about how to refactor with indexes.
3535

3636
```
3737
from collections import defaultdict
@@ -75,7 +75,7 @@ We can still use a dictionary to count the occurances, but we can also keep a se
7575
This will represent the number of unique valid characters of T.
7676

7777
If T = 'abcc', then there are 3 keys in the dictionary.
78-
When ever we increment a key in the dictionary, we can then compare the dictionary T's count with dictionary S's count.
78+
Whenever we increment a key in the dictionary, we can then compare the dictionary T's count with dictionary S's count.
7979
If S's count equals exactly what T's count is, then we just got one of the 3 keys validated.
8080
If we decrement, and S's count is T's count-1, then we just unvalidated one of those keys.
8181

0 commit comments

Comments
 (0)