First, we need to modify the matrix multiplication algorithm to work with integers modulo $k$. This means that all the arithmetic operations (addition and multiplication) should be performed modulo $k$. Specifically, when computing the dot product of two vectors,
Show more…