Tap here to switch tabs
Problem
Submissions

Problem: Minimum Size Subarray Sum

Minimum Size Subarray Sum asks you to find the shortest contiguous portion of a positive-integer array whose total is at least a given target, returning zero if none qualifies.

Statement

Given an array of positive integers, nums, and a positive integer, target, find the minimum length of a contiguous subarray whose sum is greater than or equal to the target. If no such subarray is found, return 0.

Constraints:

  • 11 ≤\leq target ≤\leq 10410^4
  • 11 ≤\leq nums.length ≤\leq 10310^3
  • 11 ≤\leq nums[i] ≤\leq 10310^3
⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Size Subarray Sum

Minimum Size Subarray Sum asks you to find the shortest contiguous portion of a positive-integer array whose total is at least a given target, returning zero if none qualifies.

Statement

Given an array of positive integers, nums, and a positive integer, target, find the minimum length of a contiguous subarray whose sum is greater than or equal to the target. If no such subarray is found, return 0.

Constraints:

  • 11 ≤\leq target ≤\leq 10410^4
  • 11 ≤\leq nums.length ≤\leq 10310^3
  • 11 ≤\leq nums[i] ≤\leq 10310^3