Tap here to switch tabs
Problem
Submissions

Problem: Max Non-Overlapping Subarrays With Sum Equal to Target

Try to solve the Maximum Number of Non-Overlapping Subarrays With Sum Equals Target problem.

Statement

Given an integer array nums and an integer target, return the maximum number of non overlapping, non empty subarrays where the sum of elements in each subarray equals target.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • −104≤-10^4 \leq nums[i] ≤104\leq 10^4

  • 0≤0 \leq target ≤106\leq 10^6

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Max Non-Overlapping Subarrays With Sum Equal to Target

Try to solve the Maximum Number of Non-Overlapping Subarrays With Sum Equals Target problem.

Statement

Given an integer array nums and an integer target, return the maximum number of non overlapping, non empty subarrays where the sum of elements in each subarray equals target.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • −104≤-10^4 \leq nums[i] ≤104\leq 10^4

  • 0≤0 \leq target ≤106\leq 10^6