The array is [0,2,1,-3] with target as 1, shouldn't the three numbers be 0, 2 and 1, summing to a total of 3? Why is the expected output shown as 0?
Because 2 + 1 + -3 is 0, which is closer to 1.
oh I see, I misunderstood the question. I thought it was picking 3 numbers closest to target then summing them. thanks.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.