← 返回 bytedance 的题目列表Find All Continuous Subarrays Summing to Target Value
类型:online_judge
bytedance
Find all continuous subarrays in a list of integers that sum up to a specific target value. Implement this as a function and return these subarrays.
Input:
An array arr consisting of integers.
An integer target representing the target sum.
Output:
Return an array containing all continuous subarrays whose sum is target.
Example:
For input arr = [1, 2, 3, 4, 5], target = 5:
The output should be [[2, 3], [5]].
Constraints:
Length of the array should not exceed 10,000.
Each element could range from [-1,000,000, 1,000,000].
Example
Input
1 2 3 4 5 5