Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 557 Bytes

File metadata and controls

13 lines (10 loc) · 557 Bytes

Problem 7: Minimal Contiguous Span (Minimum Size Subarray Sum)

Problem Statement

Given an array of positive integers nums and a positive integer target, return the minimal length of a contiguous subarray of which the sum is greater than or equal to target. If there is no such subarray, return 0 instead.

Input Format

  • An array of integers nums.
  • An integer target.

Example

Input: target = 7, nums = [2, 3, 1, 2, 4, 3]
Output: 2
Explanation: The subarray [4, 3] has the minimal length under the problem constraint.