diff --git a/algorithm/sliding_window.py b/algorithm/sliding_window.py index 222dec1..214b8bc 100644 --- a/algorithm/sliding_window.py +++ b/algorithm/sliding_window.py @@ -22,7 +22,7 @@ def sliding_window_template_with_examples(s, p): # loop the source string from begin to end while end < len(s): - counter[s[end]] += 1 + counter[s[end]] -= 1 # update count based on some condition if counter[s[end]] > 1: count += 1 @@ -49,4 +49,4 @@ def sliding_window_template_with_examples(s, p): return res -# refer to https://leetcode.com/problems/minimum-window-substring/discuss/26808/here-is-a-10-line-template-that-can-solve-most-substring-problems \ No newline at end of file +# refer to https://leetcode.com/problems/minimum-window-substring/discuss/26808/here-is-a-10-line-template-that-can-solve-most-substring-problems