I have a question about "subarray"

  • 0

    Does anyone can help me about the "subarray" ?
    Is it must continuous?

    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
    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.