Matrix Multiplication
We learn matrix multiplication in school, but it is much simpler with the help of programming. Basically two matrices A[n][k] and B[k][m] can be multiplied in time O(n*k*m). Exemplified by this LC problem: https://leetcode.com/problems/sparse-matrix-multiplication/ Given two sparse matrices A and B , return the result of AB . You may assume that A 's column number is equal to B 's row number. Example: Input: A = [ [ 1, 0, 0], [-1, 0, 3] ] B = [ [ 7, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, 1 ] ] Output: | 1 0 0 | | 7 0 0 | | 7 0 0 | AB = | -1 0 3 | x | 0 0 0 | = | -7 0 3 | | 0 0 1 | The solution is given down below, literally just following the rules of matrices multiplication . Cheers, ACC. public class Solution { public int[][] Multiply(int[][] A, int[][] B) { int[][] result = new int[A.Length][]; f...