AI Features

Minimum Size Subarray Sum

Given an array of integers and a target, return the length of the shortest contiguous subarray whose sum is greater than or equal to the target.

Statement

Given an array of positive integers, nums, along with a positive integer, target. Find the length of the shortest contiguous subarray whose sum is greater than or equal to the target. If there is no such subarray, return 0 instead.

Example

Sample input

 ...