Concept of array named c [ ] is not clear

c[ i ] = a[ i ] - b[ i ]: this is clear
but,
-c[ j ] = b[ j ] - a[ j ]: this is not clear,
and why the minus sign ? Please help me out as i am very new to competitive programming.

@rishabh5544 it is basically like the above equation only, we just multiplied both sides by -1.

why we are doing so ?

@rishabh5544 watch the video again, it has been explained there only. Let me know if you have any confusion regarding it

didn’t understand the explanation in the video
please explain the line i have commented…

@rishabh5544
you need to make c[i] - c[j]
because the question is for a[i] - b[i]
so to make the equation equivalent to that, we have done this.
watch the implementation part as well it will become more clear

1 Like

Now I get it, Thank you so much Ishita.

1 Like