Problem Given an unsorted array A of size N of non-negative integers, find a continuous subarray which adds to a given number S [closed]

  arrays, c++

Constraints
1 <= N <= 105
0 <= Ai <= 1010
Example
Input:
N = 5, S = 12
A[] = {1,2,3,7,5}
Output: 2 4
Explanation: The sum of elements from 2nd position to 4th position is 12.

please telll me about this answer

Source: Windows Questions C++

LEAVE A COMMENT