1
Introduction
Let's observe this array: [3, 2, 4, 1, 1, 5, 1, 2].
Each element displays the length of the substring which must be summed up. Let's take a look at the first element of the above array:
[3, 2, 4, 1, 1, 5, 1, 2]
^
The element at the first index is 3, so we now take a substring o...