Given a list of integer sequences like the following:
0, 1, 2, 3
4, 7, 8, 9
10, 12, 14, 15, 17
Find the integer sequence for which alternating adding and subtracting the components like below produces the highest result, which we call the highest alternating integer sequence:
n_1 + n_2 - n_3 + n_4 - n_5 + ...
Given that the results for the three above sequences are:
- 2
- 12
- 6
We know that the second integer sequence is the highest alternating integer sequence.
Write a function that will take an array of arrays, each containing integer sequences, and returns the index of the highest alternating integer sequence.