I have a question about "subarray"


  • 0
    Z

    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.


  • 0

    Yes, continuous. But look for "sum ≥ s" as requested, not for "sum = s".


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.