testCase [1,4,1,3,1,-14,1,-13] should be false or true?


  • 0
    Y

    why [1,4,1,3,1,-14,1,-13] return false. it shoudl be true for i = 1, j = 3, k = 6 match.
    [1,4,1,3,1,-14,1,-13]
    i = 1, j = 3, k = 6
    sum(0, i - 1) = sum(0, 0) = 1
    sum(i + 1, j - 1) = sum(2, 2) = 1
    sum(j + 1, k - 1) = sum(4, 5) = 1 + (-14) = -13
    sum(k + 1, n - 1) = sum(7, 7) = -13


Log in to reply
 

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