Why must we use the expression -X = Y + Z

If we are trying to ask the sum to be zero, we know the starting index of arr[i] a left and a right.

So couldn’t we do the comparison: arr[i] + left + right === 0

I don’t understand why we need to use -X = Y + Z in this case

Hi @Sean_Thomas, We are taking left equals to the exact digit which is not being duplicated for e.g in this array [-3, -2, -1], left would be equal to index 1 which points to the value -2. Here we are taking X = 3 and the right will act as the second pointer which will point the last element of the array which is -1 here. So -arr[i] == right+left (-X = Y+Z) , so it would be our triplet sum equal to zero.