![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
1. Pattern: Sliding window
1. Pattern: Sliding window,滑动窗口类型
5jerry
这个作者很懒,什么都没留下…
展开
-
Longest Substring with Same Letters after Replacement (hard)
刷题参考:https://blog.csdn.net/IBelieve2016/article/details/104544763/*Given a string that consists of only uppercase English letters,you can replace any letter in the string with another letter at most k times.Find the length of a longest substring cont原创 2021-01-07 16:23:40 · 228 阅读 · 0 评论 -
No-repeat Substring (hard)
刷题参考:https://blog.csdn.net/IBelieve2016/article/details/104544763#include<iostream>#include<vector>#include <unordered_set>#include<string> using namespace std;/*非重复最长字串left定位子串开头 用一个set检查当前char[i]是否存在如果存在将set中的char[left原创 2021-01-07 16:22:52 · 245 阅读 · 0 评论 -
Fruits into Baskets (medium)
刷题参考:https://blog.csdn.net/IBelieve2016/article/details/104544763/*In a row of trees, the `i`-th tree produces fruit with type `tree[i]`.You start at any tree of your choice, then repeatedly perform the following steps:Add one piece of fruit from th原创 2021-01-07 16:22:00 · 116 阅读 · 0 评论 -
Longest Substring with K Distinct Characters (medium)
刷题参考:https://blog.csdn.net/IBelieve2016/article/details/104544763#include<iostream>#include<vector>#include <unordered_map>#include<string>using namespace std;/*Given a string, find the length of the longest substring T t.原创 2021-01-07 16:20:53 · 271 阅读 · 0 评论 -
Smallest Subarray with a given sum (easy)
刷题参考:https://blog.csdn.net/IBelieve2016/article/details/104544763#include<iostream>#include<vector>#include <unordered_map>using namespace std;/*Given an unsorted array of nonnegative integers, find a continous subarray which add.原创 2021-01-07 16:19:49 · 295 阅读 · 0 评论 -
Maximum Sum Subarray of Size K (easy)
/*Given an array nums and a target value k, find the maximum length of a subarray that sums to k.If there isn't one, return 0 instead.Note:The sum of the entire nums array is guaranteed to fit within the 32-bit signed integer range.Example 1:Inpu.原创 2021-01-07 16:16:54 · 214 阅读 · 0 评论