Within my array, there are 100 subarrays, each containing 3160 values of an object with two attributes: a sequence number (which only appears if it is present as 1), and another value of either 0 or 1.
My goal is to merge all 100 arrays into one single array consisting of 3160 values of an object. This new array should have a list of all the sequence numbers found in the original arrays, along with the total sum of all the 0s and 1s combined.
I attempted to use concatenation, but I want to ensure that the final array does not exceed 3160 entries.
/* Current structure of my data:
Array(100)
[0]Array(3160)
[0]: Seq: 12345
fq: 1
[1]: Seq: 12345
fq: 0
[2]: Seq: 12345
fq: 1
[3]: Seq: 12345
fq: 0
...and so on...
[1]Array(3160)
[0]: Seq: 12346
fq: 1
[1]: Seq: 12346
fq: 1
[2]: Seq: 12346
fq: 0
[3]: Seq: 12346
fq: 0
...and so on...
[2]Array(3160)
[0]: Seq: 12347
fq: 1
[1]: Seq: 12347
fq: 0
[2]: Seq: 12347
fq: 1
[3]: Seq: 12347
fq: 0
...and so on...
...and so on...
Desired Output:
Array(3160)
[0]: Seq: 12345, 12346, 12347
fq: 3
[1]: Seq: 12346
fq: 1
[2]: Seq: 12345, 12347
fq: 2
[3]: Seq:
fq: 0
*/