1、尺取法,对于孤陋寡闻的我来说,刷题之前没听说过,后来了解了一下这个方法,感觉好多题目都可以用这个方法解决,在leetcode上有一类题叫做Two Pointers,其中一部分题目就应该使用尺取法来解决 。
【leetcode主要算法】2、在介绍尺取法的使用之前,先看一个典型的实例Leetcode209. Minimum Size Subarray Sum:Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't one, return 0 instead.For example, given the array [2,3,1,2,4,3] and s = 7,the subarray [4,3] has the minimal length under the problem constraint.
推荐阅读
- 侠客行故事简介
- 日本豆腐主要原料「日本豆腐是什么做的材料」
- 草原的主要内容
- 5s是指哪五项
- 线上线下通俗来说是什么意思
- iphone12和12mini区别
- 狮群的狩猎主要是「狮群的狩猎主要是由雄狮来完成的吗对吗」
- 游戏的主要心理结构 游戏的主要心理结构包括认知与情感
- 维a酸乳膏去黑头用法
- 年轻人肩周炎什么症状
