
1. Pattern: Sliding window
1. Pattern: Sliding window,滑动窗口类型
5jerry
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Longest Substring with Same Letters after Replacement (hard)
刷题参考:https://blog.youkuaiyun.com/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 · 265 阅读 · 0 评论 -
No-repeat Substring (hard)
刷题参考:https://blog.youkuaiyun.com/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 · 289 阅读 · 0 评论 -
Fruits into Baskets (medium)
刷题参考:https://blog.youkuaiyun.com/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 · 158 阅读 · 0 评论 -
Longest Substring with K Distinct Characters (medium)
刷题参考:https://blog.youkuaiyun.com/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 · 421 阅读 · 0 评论 -
Smallest Subarray with a given sum (easy)
刷题参考:https://blog.youkuaiyun.com/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 · 358 阅读 · 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 · 264 阅读 · 0 评论