双指针做题总结2(滑动窗口)
窗口大小固定:串联所有单词的子串https://leetcode.cn/problems/substring-with-concatenation-of-all-words/description/?envType=study-plan-v2&envId=top-interview-150
窗口大小不固定:最小覆盖子串 https://leetcode.cn/problems/minimum-window-substring/?envType=study-plan-v2&envId=top-interview-150
76.最小覆盖子串
思路:
双指针滑动窗口问题,指针的移动条件是双指针的核心。
反思:
1、考虑右指针已经移动到最右端,无法继续移动的情况。(flag1的思路)
2、用map.empty()是要千万注意:map[key]相当于往map中添加元素
代码:
见Leecode
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现