If I have golf search results:
-3, +5, -3, 0, +1, +8, 0, +6, +2, -8, +5
I need to find a sequence of three adjacent numbers having a minimal sum. In this example, the subsequence will look like this:
[-3, +5, -3] [+5, -3, 0] [-3, 0, +1] ... etc ... [+2, -8, +5]
And the minimum sequence will be [-3, 0, +1] with the sum of -2.
source share