...

/

Sparse Matrix Multiplication

Sparse Matrix Multiplication

Description

We have two sparse matrices, A and B.

“A sparse matrix is one in which most of the elements are zero.”

You need to multiply the two matrices and return the output matrix. You can assume that A’s column number is equal to B’s row number.

Constraints

The following are some constraints:

  • 1 <= A.length, B.length <= 100
  • 1 <= A[i].length, B[i].length <= 100
  • -100 <= A[i][j], B[i][j] <= 100

Let’s review this scenario using the example below:

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy