滑动窗口
cy1622
这个作者很懒,什么都没留下…
展开
-
Smallest Subarray with a given sum
Smallest Subarray with a given sum Problem Statement Given an array of positive numbers and a positive number ‘S’, find the length of the smallest contiguous subarray whose sum is greater than or equal to ‘S’. Return 0, if no such subarray exists. Example原创 2021-04-01 22:47:29 · 213 阅读 · 0 评论 -
Maximum Sum Subarray of Size K(最大子数组和为k)
Maximum Sum Subarray of Size K(最大子数组和为k) Problem Statement Given an array of positive numbers and a positive number ‘k’, find the maximum sum of any contiguous subarray of size ‘k’. Example Input: [2, 1, 5, 1, 3, 2], k=3 Output: 9 Explanation: Subarray wi原创 2021-04-01 22:41:50 · 325 阅读 · 0 评论