Sparse Matrix Multiplication

easy
1. You will be given two Sparse Matrices, 2d arrays 2. You need to find their product. 3. Input and Output is handled for you 4. It is a functional problem, please do not modify main() Note: A sparse matrix is one, where a lot of its elements are 0

Input Format

Input is handled for you.

Output Format

Output is handled for you.

Constraints

Assume that A's column number is equal to B's row number.

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
3 4
1 1 0 1 
2 1 0 0 
0 0 0 2 
4 2
2 0 
1 0 
2 0 
1 2
Output
4 2 
5 0 
2 4
Previous
Sorting Elements Of An Array By Frequency
Next
String Subsequence Game

Related Questions