Testcase question - can max sum for array[] = [-1] be 0 with 0 length subarray?

  • 0

    For array [-1], the sum is returned as -1 but we can have an empty subarray (nowhere in the question it states return nonempty contiguous subarray) of larger sum if all elements are negative

  • 0

    NO, at least one element should be counted in. So, the answer should be -1.

Log in to reply

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