leetcode主要算法


1尺取法,针对孤陋寡闻的我而言,做题以前没听说过,之后了解了一下这个方式,觉得许多题目都能够用这个方法解决,在leetcode上有一类题称为Two pointers,其中一部分题目就应当应用尺取法来解决 。
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.
【leetcode主要算法】