Question about Example Case

  • 0

    I have a question about this example case given with this problem:

    Example 2:
    Given nums = [-2, -1, 2, 1], k = 1,
    return 2. (because the subarray [-1, 2] sums to 1 and is the longest)

    Does the subarray of -2 + 2 + 1, with a length of 3 not equal 1 to satisfy the problem, and if that subarray is not a candidate to solve the problem, can you please explain why?

  • 0

    Subarray is by itself continuous. Nothing wrong with the wording. Subsequence can be noncontinuous

Log in to reply

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