When the ship has along x these blocks:
1 2 3 2 |1| 2 2 2 2
I did result=(result[i-1] default: 0)+x:
1, +2=3, +3=6, +2=8, +1=9
2, +2=4, +2=6 +2=8, +1=9
-> I had an index of 5 in:
1 3 6 8 |9| 8 6 4 2
used left & right = 9 and forgot that intermediate result, as it is not required any-more
I...