Hmm, so we have some pairs of three, interesting . . .
Is the data already sorted in such a way that all members of the same group are next to each other ?
Is it possible that you could also have a "pair" like this . . .
Example E 100
Example E 10
Example E -50
Example E -60
... ?
Could you have more than one set of numbers for the same item? For example..Yes, that works also. See how it nets to 0.
Could you have more than one set of numbers for the same item? For example..
Example E 100
Example E 15
Example E 40
Example E 10
Example E -25
Example E -50
Example E -60
Example E -20
Or would that be considered as just a large set like this...
Example E 100
Example E 15
Example E 40
Example E 10
Example E -25
Example E -50
Example E -60
Example E -20
In addition to Gerald's question above, I would like to know if you know, in advance, what text for Example 1, Example 2, etc. are? In other words, do you already have a list of each unique Example text that we can refer to (if yes, where is the list located) or do we have to create the list of unique Example text from your complete list ourselves?Repeat of a question from post #10
Is the data already sorted in such a way that all members of the same group are next to each other ?
In addition to Gerald's question above, I would like to know if you know, in advance, what text for Example 1, Example 2, etc. are? In other words, do you already have a list of each unique Example text that we can refer to (if yes, where is the list located) or do we have to create the list of unique Example text from your complete list ourselves?
How about an answer to the question in post #10, repeated in post #14 ?
OK, so I think we're getting somewhere, at least in terms of understanding the problem.
To recap, we have a list of positive and negative entries.
These entries are pre-sorted, so that all entries that SHOULD be grouped, are in fact already grouped together somehow.
The size of these groups is at least two, but could in theory also be any size larger than two.
If we take all the values in a single group, they sum to zero.
We have no information at all about the size of each group, other than that its members sum to zero, and that the number of members is at least two.
Therefore the task includes identifying where one group ends and another group begins.
Is this an accurate description of the problem ?
If yes, then it seems like we might be able to use some kind of running total, and whenever it reaches zero, use that as an indication that the group is complete.
Could that work ?
Is it possible that a subgroup within a group could independently sum to zero ?
For example, could you have a group like this -
100
10
-110
110
-10
-100
A cumulative sum would reach zero on the third entry, suggesting that the first three entries were a group.
But if your definition of this particular group is all 6 entries, then my suggestion would not work.