311. Sparse Matrix Multiplication

Problem

Given two sparse matrices A and B, return their product AB without using built-in dense matrix multiplication.

Given two sparse matrices A and B, compute their product A × B. A sparse matrix is one where most elements are zero. Use the sparse representation to optimize computation.

Examples
Input: [[[1,0,0],[-1,0,3]],[[7,0,0],[0,0,0],[0,0,1]]]
Output: [[7,0,0],[-7,0,3]]
Hints
Related Problems

311. Sparse Matrix Multiplication

Given two sparse matrices A and B, return their product AB without using built-in dense matrix multiplication.