Skip to content

Commit 2cb07ab

Browse files
authored
Update slide-window.md
1 parent 7330d01 commit 2cb07ab

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

thinkings/slide-window.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@
4949

5050
## 模板代码
5151

52+
### 伪代码
53+
```
54+
初始化慢指针 = 0
55+
初始化 ans
56+
57+
for 快指针 in 可迭代集合
58+
更新窗口内信息
59+
while 窗口内不符合题意
60+
扩展或者收缩窗口
61+
慢指针移动
62+
返回 ans
63+
```
64+
### 代码
65+
5266
以下是 209 题目的代码,使用 Python 编写,大家意会即可。
5367

5468
```python
@@ -82,4 +96,4 @@ class Solution:
8296

8397
## 扩展阅读
8498

85-
- [LeetCode Sliding Window Series Discussion](https://leetcode.com/problems/binary-subarrays-with-sum/discuss/186683/)
99+
- [LeetCode Sliding Window Series Discussion](https://leetcode.com/problems/binary-subarrays-with-sum/discuss/186683/)

0 commit comments

Comments
 (0)