The Quickest and easiest way to find the mod of a negative number is by using the below property
if a = (b) mod c then a = (c*k + b) mod c (where k = 1,2,3.......)
It simply says that the value of a is unchanged when we add a multiple of c to b
a = (-10) mod 3
Now i add 12 to 10 as 12 is a multiple of 3 and hence the value of a will remain unchanged
Now i add 12 to 10 as 12 is a multiple of 3 and hence the value of a will remain unchanged
so a = (3*4 – 10) mod 3 = 2 mod 3 = 2