Write a program that operates on an array and prints all subarrays that sum to a
specific number. Input to your program will be an unsorted array of integers, let’s
call it A, and a number N. You have to implement the functionality that finds all the
subarrays of A such that the sum of all elements within a subarray is N.
Example
Input: A = [4, 3, 2, 16, 7, 5], N = 9
Output: [4,5], [4,3,2], [2,7]
Note: [4,2,3] and [3,4,2] should be considered one subarray as both contain same
numbers.
Answers
Answered by
0
Answer:
⊂((・▽・))⊃first follow me then I will gave your answer
Similar questions