Help- Counting Ways to Partition an Array into Segments with Positive Sum

Revision en2, by Kr_Shubham, 2024-03-17 16:06:32

Find the number of ways to partition array into segments such that sum of each segments is greater than 0,

Note- Concatenating the segments should result into full array.

Constraints: 1<=N<=10^5 1<=a[I]<=10^9 Example:

Input1: N=3, a[]={-1,-3,7}

Output: 1. (Complete array as one Segment)

Thanks

PS. This is not part of any running Contest.

Tags help me, coding, problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Kr_Shubham 2024-03-17 16:06:32 42 Adding Constraints
en1 English Kr_Shubham 2024-03-17 16:02:24 400 Initial revision (published)