Minimum Size Subarray Sum(追击指针)
Given an array ofnpositive integers and a positive integers, find the minimal length of acontiguoussubarray of which the sum ≥s. If there isn't one, return 0 instead.
Example:
分析
窗口类前向追击指针,注意这里sum < s要放在while里判断。防止j已经取过了头才退出。先判断再加J
Last updated