Does anyone can help me about the "subarray" ?

Is it must continuous?

for

10

[1,2,3,4,5,6,7,8,9]

the answer is 2.. '2' means 1+9 or 3+7 or, so the element in array no need be continuous?

if so,

for test case

8

[1,2,2,1,3,2,2,2,2,5]

the expect answer is 3, '3' means 1+2+5? why not 3+5? the length is just 2.