Given an integer array and a target, return all contiguous subarrays whose sum equals the target.
Unlock detailed company stats for this questionUpgrade
Example: nums = [10, 5, 2, 7, 1, 12, 15, 25, 36, 8, 3], target = 15 gives [10, 5], [5, 2, 7, 1] and [15].
Expect follow-ups like
- Solve it with a sliding window and compare the complexity with prefix sum, and say which is better.
Community answers
No answers contributed by the community yet.
Related questions
Given an integer array nums and an integer k, return the number of contiguous subarrays whose product equals k.Given an array of integers and an integer k, find the number of continuous subarrays whose sum equals k.Find all pairs in an array whose sum equals a target.Related courses

Course

Course
Course
